Skip to content

Commit b9dfb59

Browse files
committed
Restore workflows
1 parent ef69fed commit b9dfb59

File tree

2 files changed

+87
-94
lines changed

2 files changed

+87
-94
lines changed

.github/workflows/pr-open.yml

+52-58
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,57 @@ concurrency:
1010
permissions: {}
1111

1212
jobs:
13-
# build:
14-
# name: Build
15-
# runs-on: ubuntu-24.04
16-
# permissions:
17-
# packages: write
18-
# strategy:
19-
# matrix:
20-
# package: [admin, api, db, public]
21-
# include:
22-
# - package: admin
23-
# build_context: ./
24-
# build_file: admin/Dockerfile
25-
# triggers: ('admin/' 'libs/')
26-
# - package: api
27-
# build_context: ./
28-
# build_file: api/Dockerfile
29-
# triggers: ('api/' 'libs/')
30-
# - package: db
31-
# triggers: ('db')
32-
# - package: public
33-
# build_context: ./
34-
# build_file: public/Dockerfile
35-
# triggers: ('public/' 'libs/')
36-
# steps:
37-
# - uses: actions/checkout@v4
38-
# - uses: bcgov-nr/[email protected]
39-
# with:
40-
# package: ${{ matrix.package }}
41-
# build_context: ${{ matrix.build_context }}
42-
# build_file: ${{ matrix.build_file }}
43-
# keep_versions: 100
44-
# tag: ${{ github.event.number }}
45-
# tag_fallback: latest
46-
# token: ${{ secrets.GITHUB_TOKEN }}
47-
# triggers: ${{ matrix.triggers }}
13+
build:
14+
name: Build
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
packages: write
18+
strategy:
19+
matrix:
20+
package: [admin, api, db, public]
21+
include:
22+
- package: admin
23+
build_context: ./
24+
build_file: admin/Dockerfile
25+
triggers: ('admin/' 'libs/')
26+
- package: api
27+
build_context: ./
28+
build_file: api/Dockerfile
29+
triggers: ('api/' 'libs/')
30+
- package: db
31+
triggers: ('db')
32+
- package: public
33+
build_context: ./
34+
build_file: public/Dockerfile
35+
triggers: ('public/' 'libs/')
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: bcgov-nr/[email protected]
39+
with:
40+
package: ${{ matrix.package }}
41+
build_context: ${{ matrix.build_context }}
42+
build_file: ${{ matrix.build_file }}
43+
keep_versions: 100
44+
tag: ${{ github.event.number }}
45+
tag_fallback: latest
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
triggers: ${{ matrix.triggers }}
4848

49-
# deploy:
50-
# name: Deploy (${{ github.event.number }})
51-
# needs: [build]
52-
# secrets: inherit
53-
# uses: ./.github/workflows/.deploy.yml
54-
# with:
55-
# db_testdata: true
56-
# triggers: ('db/' 'libs/' 'api/' 'admin/' 'public/')
57-
58-
# results:
59-
# name: PR Results
60-
# needs: [build, deploy]
61-
# if: always()
62-
# runs-on: ubuntu-24.04
63-
# steps:
64-
# - if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
65-
# run: echo "At least one job has failed." && exit 1
66-
# - run: echo "Success!"
67-
68-
release:
69-
name: PROD Release
70-
# needs: build
49+
deploy:
50+
name: Deploy (${{ github.event.number }})
51+
needs: [build]
7152
secrets: inherit
72-
uses: ./.github/workflows/release.yml
53+
uses: ./.github/workflows/.deploy.yml
54+
with:
55+
db_testdata: true
56+
triggers: ('db/' 'libs/' 'api/' 'admin/' 'public/')
57+
58+
results:
59+
name: PR Results
60+
needs: [build, deploy]
61+
if: always()
62+
runs-on: ubuntu-24.04
63+
steps:
64+
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
65+
run: echo "At least one job has failed." && exit 1
66+
- run: echo "Success!"

.github/workflows/release.yml

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: Release
32

43
on:
@@ -29,44 +28,44 @@ jobs:
2928
with:
3029
aws_user_pools_web_client_id: 4bu2n8at3m32a2fqnvd4t06la1
3130
batch_client_rfsh_api_tkn_op_secret_name: fom-client-app-api
32-
# environment: prod
31+
environment: prod
3332
email_notify: [email protected]
3433
logout_chain_url: https://logon7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/logout?redirect_uri=
3534
tag: ${{ inputs.tag }}
3635
target: prod
37-
# url: fom.nrs.gov.bc.ca
36+
url: fom.nrs.gov.bc.ca
3837

39-
# images-backup:
40-
# name: Backup images (PROD)
41-
# continue-on-error: true # If no prod tags
42-
# needs: deploy
43-
# permissions:
44-
# packages: write
45-
# runs-on: ubuntu-24.04
46-
# strategy:
47-
# matrix:
48-
# component: [api, admin, db, public]
49-
# steps:
50-
# - uses: shrink/actions-docker-registry-tag@v4
51-
# with:
52-
# registry: ghcr.io
53-
# repository: ${{ github.repository }}/${{ matrix.component }}
54-
# target: prod
55-
# tags: prod-backup
38+
images-backup:
39+
name: Backup images (PROD)
40+
continue-on-error: true # If no prod tags
41+
needs: deploy
42+
permissions:
43+
packages: write
44+
runs-on: ubuntu-24.04
45+
strategy:
46+
matrix:
47+
component: [api, admin, db, public]
48+
steps:
49+
- uses: shrink/actions-docker-registry-tag@v4
50+
with:
51+
registry: ghcr.io
52+
repository: ${{ github.repository }}/${{ matrix.component }}
53+
target: prod
54+
tags: prod-backup
5655

57-
# images-promote:
58-
# name: Promote images (PROD)
59-
# needs: deploy, images-backup
60-
# permissions:
61-
# packages: write
62-
# runs-on: ubuntu-24.04
63-
# strategy:
64-
# matrix:
65-
# component: [api, admin, db, public]
66-
# steps:
67-
# - uses: shrink/actions-docker-registry-tag@v4
68-
# with:
69-
# registry: ghcr.io
70-
# repository: ${{ github.repository }}/${{ matrix.component }}
71-
# target: ${{ needs.deploy.outputs.tag }}
72-
# tags: prod
56+
images-promote:
57+
name: Promote images (PROD)
58+
needs: deploy, images-backup
59+
permissions:
60+
packages: write
61+
runs-on: ubuntu-24.04
62+
strategy:
63+
matrix:
64+
component: [api, admin, db, public]
65+
steps:
66+
- uses: shrink/actions-docker-registry-tag@v4
67+
with:
68+
registry: ghcr.io
69+
repository: ${{ github.repository }}/${{ matrix.component }}
70+
target: ${{ needs.deploy.outputs.tag }}
71+
tags: prod

0 commit comments

Comments
 (0)