1- name : Build and Push Dev Docker Image
1+ name : Build and Push Docker Image
22
33on :
44 workflow_dispatch :
1111 - ' .github/**'
1212 - ' vercel.json'
1313 - ' .gitignore'
14+ - ' CHANGELOG.md'
15+ - ' version.txt'
1416
1517jobs :
1618 semantic-release :
@@ -22,14 +24,13 @@ jobs:
2224 - uses : actions/checkout@v2
2325 with :
2426 fetch-depth : 0
25- token : ${{ secrets.GH_TOKEN }}
27+ token : ${{ secrets.GITHUB_TOKEN }}
2628
2729 - name : Git Configuration
2830 run : |
2931 git config --global user.name "iidamie"
3032 git config --global user.email "iidamie@users.noreply.github.com"
3133
32-
3334 - name : Semantic Release
3435 id : semantic
3536 uses : cycjimmy/semantic-release-action@v4
@@ -39,17 +40,17 @@ jobs:
3940 @semantic-release/git
4041 @semantic-release/changelog
4142 env :
42- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4344
4445 build-and-push :
4546 needs : semantic-release
4647 runs-on : ubuntu-latest
47- if : ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
48+ if : ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
4849 steps :
4950 - uses : actions/checkout@v2
5051 with :
5152 fetch-depth : 0
52- token : ${{ secrets.GH_TOKEN }}
53+ token : ${{ secrets.GITHUB_TOKEN }}
5354
5455 - name : Set up Docker Buildx
5556 uses : docker/setup-buildx-action@v1
@@ -60,21 +61,30 @@ jobs:
6061 username : ${{ secrets.DOCKER_USERNAME }}
6162 password : ${{ secrets.DOCKER_PASSWORD }}
6263
63- - name : Read the version from version.txt
64+ - name : Login to GHCR
65+ uses : docker/login-action@v1
66+ with :
67+ registry : ghcr.io
68+ username : ${{ github.actor }}
69+ password : ${{ secrets.GITHUB_TOKEN }}
70+
71+ - name : Get version
6472 id : get_version
6573 run : |
6674 version=${{ needs.semantic-release.outputs.new_release_version }}
6775 echo "Current version: v$version"
6876 echo "::set-output name=version::v$version"
6977
70- - name : Build and push Docker image
78+ - name : Build and push multi-arch images
7179 uses : docker/build-push-action@v2
7280 with :
7381 context : .
7482 file : ./Dockerfile
7583 push : true
7684 tags : |
77- iidamie/deepseek2api:${{ steps.get_version.outputs.version }}
78- iidamie/deepseek2api:dev
85+ ${{ secrets.DOCKER_USERNAME }}/deepseek2api:${{ steps.get_version.outputs.version }}
86+ ${{ secrets.DOCKER_USERNAME }}/deepseek2api:dev
87+ ghcr.io/${{ github.actor }}/deepseek2api:${{ steps.get_version.outputs.version }}
88+ ghcr.io/${{ github.actor }}/deepseek2api:dev
7989 platforms : linux/amd64,linux/arm64
80- build-args : TARGETPLATFORM=${{ matrix.platform }}
90+ build-args : TARGETPLATFORM=${{ matrix.platform }}
0 commit comments