File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,13 @@ name: Publish Docker image
33on :
44 release :
55 types : [published]
6+ pull_request :
7+ types : [closed]
8+ branches : [master]
69
710jobs :
811 push_to_registries :
12+ if : github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
913 name : Push Docker image to multiple registries
1014 runs-on : ubuntu-latest
1115 permissions :
@@ -22,21 +26,26 @@ jobs:
2226 uses : docker/setup-buildx-action@v2
2327
2428 - name : Log in to the Container registry
25- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
29+ uses : docker/login-action@v2
2630 with :
2731 registry : ghcr.io
2832 username : ${{ github.actor }}
2933 password : ${{ secrets.GITHUB_TOKEN }}
3034
3135 - name : Extract metadata (tags, labels) for Docker
3236 id : meta
33- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
37+ uses : docker/metadata-action@v4
3438 with :
3539 images : |
3640 ghcr.io/${{ github.repository }}
41+ tags : |
42+ type=semver,pattern={{version}}
43+ type=ref,event=branch
44+ type=sha,format=short
45+ latest
3746
3847 - name : Build and push Docker images
39- uses : docker/build-push-action@v3
48+ uses : docker/build-push-action@v4
4049 with :
4150 context : .
4251 push : true
You can’t perform that action at this time.
0 commit comments