generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.59 KB
/
pr-open.yml
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
53
54
55
56
57
58
59
name: Pull Request
on:
pull_request:
concurrency:
# PR open and close use the same group, allowing only one at a time
group: ${{ github.event.number }}
cancel-in-progress: true
jobs:
builds:
name: Builds
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [frontend, rctool]
include:
- package: frontend
build_file: ./frontend/Dockerfile.nginx
- package: rctool
build_file: ./frontend/Dockerfile.app
steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/[email protected]
with:
package: ${{ matrix.package }}
build_file: ${{ matrix.build_file }}
build_context: ./frontend
tag: ${{ github.event.number }}
tag_fallback: latest
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ('frontend/')
# https://github.com/bcgov/quickstart-openshift-helpers
deploys:
name: Deploys
needs: [ builds ]
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected]
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
triggers: ('frontend/')
params: --set global.secrets.persist=false
oc_server: ${{ vars.OC_SERVER }}
results:
name: PR Results
needs: [builds, deploys]
if: always()
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"