-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.44 KB
/
build_and_push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# A workflow that builds and (optionally) pushes the Docker container image
# artifacts for the application. The build action occurs on pull request events
# that target the `main` branch, and the push action occurs only with tagged releases
# and ticket branches.
---
name: "Build and Push"
"on":
pull_request:
branches:
- main
paths:
- 'src/lsst/cmservice/**'
push:
tags:
- "*"
workflow_dispatch:
jobs:
ci:
uses:
./.github/workflows/ci.yaml
build:
name: "Build and Push Application Container Images"
needs:
- ci
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build-service
with:
dockerfile: docker/Dockerfile
target: cmservice
image: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
push: ${{ github.ref_type == 'tag' || (github.ref_type == 'branch' && startsWith(github.ref_name, 'tickets/DM-')) }}
- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build-worker
with:
dockerfile: docker/Dockerfile
target: cmworker
image: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
push: ${{ github.ref_type == 'tag' || (github.ref_type == 'branch' && startsWith(github.ref_name, 'tickets/DM-')) }}