修改自述文件 #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: picture_api | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build image | |
run: | | |
docker build -t picture_api -f ./dockerfile . | |
- name: Export image | |
run: | | |
docker save picture_api | gzip > picture_api.tar.gz | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS }} | |
with: | |
tag_name: "" | |
release_name: Release ${{ github.sha }} | |
body: ${{ github.event.head_commit.message }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./picture_api.tar.gz | |
asset_name: picture_api.tar.gz | |
asset_content_type: application/gzip |