generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.49 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
60
61
62
name: PR
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
outputs:
triggered: ${{ steps.build.outputs.triggered }}
permissions:
packages: write
strategy:
matrix:
package: [backend, frontend, oracle-api, sync]
steps:
- uses: bcgov-nr/[email protected]
id: build
with:
build_args: |
BUILD_NUMBER=${{ github.event.number }}
BUILDKIT_INLINE_CACHE=1
package: ${{ matrix.package }}
tag: ${{ github.event.number }}
tag_fallback: latest
triggers: ('${{ matrix.package }}/')
deploys:
name: Deploys (${{ github.event.number }})
needs: [builds]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
tests:
name: Tests
if: needs.deploys.outputs.run_tests == 'true'
needs: [deploys]
secrets: inherit
uses: ./.github/workflows/.tests.yml
results:
name: PR Results
if: always()
# Include all needs that could have failures!
needs: [builds, deploys, tests]
runs-on: ubuntu-22.04
steps:
- run: |
# View results
echo "needs.*.result: ${{ toJson(needs.*.result) }}"
- if: contains(needs.*.result, 'failure')
run: |
# Job failure found
echo "At least one job has failed"
exit 1