Skip to content

Commit 15a4934

Browse files
authored
Merge pull request #3 from simonsobs/koopman/build-dev-images
Add build and push for development images on push to `main`
2 parents 8000b0b + 9744c82 commit 15a4934

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/build.yaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Publish Images to Container Registries
33
on:
44
release:
55
types: [ released ]
6+
push:
7+
branches: [ main ]
68
pull_request:
79

810
jobs:
@@ -12,6 +14,11 @@ jobs:
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 }}

0 commit comments

Comments
 (0)