File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Publish Images to Container Registries
33on :
44 release :
55 types : [ released ]
6+ push :
7+ branches : [ main ]
68 pull_request :
79
810jobs :
1214 contents : read
1315 packages : write
1416 steps :
17+ - name : Cancel Previous Runs
18+ uses : styfle/cancel-workflow-action@0.11.0
19+ with :
20+ access_token : ${{ github.token }}
21+
1522 - name : Checkout
1623 uses : actions/checkout@v3
1724
@@ -36,14 +43,20 @@ jobs:
3643 username : ${{ github.repository_owner }}
3744 password : ${{ secrets.GITHUB_TOKEN }}
3845
39- - name : Build and push
46+ - name : Build Docker metadata
47+ id : meta
48+ uses : docker/metadata-action@v4
49+ with :
50+ images : |
51+ simonsobs/scheduler-server
52+ ghcr.io/simonsobs/scheduler-server
53+ tags : |
54+ type=raw,value=${{ env.docker_tag }}
55+ type=raw,value=latest,enable=${{ github.event_name == 'release' }}
56+
57+ - name : Build and push images
4058 uses : docker/build-push-action@v4
4159 with :
4260 context : .
4361 push : ${{ github.event_name != 'pull_request' }}
44- tags : |
45- simonsobs/scheduler-server:latest
46- simonsobs/scheduler-server:${{ env.docker_tag }}
47- ghcr.io/simonsobs/scheduler-server:latest
48- ghcr.io/simonsobs/scheduler-server:${{ env.docker_tag }}
49-
62+ tags : ${{ steps.meta.outputs.tags }}
You can’t perform that action at this time.
0 commit comments