File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Build and Publish Docker Image
33on :
44 push :
55 branches : [main]
6+ release :
7+ types : [published]
68
79jobs :
810 docker-build-publish :
@@ -17,18 +19,27 @@ jobs:
1719 uses : actions/checkout@v6
1820
1921 - name : Log in to Docker Hub
20- if : github.ref == 'refs/heads/main' && github. repository == 'finos/git-proxy'
22+ if : github.repository == 'finos/git-proxy'
2123 uses : docker/login-action@v3
2224 with :
2325 username : finos
2426 password : ${{ secrets.DOCKER_PASSWORD }}
2527
28+ - name : Set Docker Image Tag
29+ id : tags
30+ run : |
31+ if [ "${{ github.event_name }}" = "release" ]; then
32+ echo "tags=finos/git-proxy:${{ github.ref_name }},finos/git-proxy:latest" >> $GITHUB_OUTPUT
33+ else
34+ echo "tags=finos/git-proxy:main" >> $GITHUB_OUTPUT
35+ fi
36+
2637 - name : Build and Publish Docker Image
27- if : github.ref == 'refs/heads/main' && github. repository == 'finos/git-proxy'
38+ if : github.repository == 'finos/git-proxy'
2839 uses : docker/build-push-action@v6
2940 with :
3041 context : .
3142 file : Dockerfile
3243 push : true
33- tags : finos/git-proxy:latest
44+ tags : ${{ steps.tags.outputs.tags }}
3445 provenance : true
You can’t perform that action at this time.
0 commit comments