Skip to content

Commit 72d6942

Browse files
authored
Merge pull request #70 from bcgov/dev
Promote dev to test
2 parents 650d402 + a859eae commit 72d6942

File tree

5 files changed

+262
-381
lines changed

5 files changed

+262
-381
lines changed

.github/workflows/graphemes_api_build.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
with:
3434
driver-opts: network=host
3535

36-
# PRs to the `dev` branch push to the `dev` environment in OpenShift
37-
# PRs to `test` push to `test`
38-
# PRs to `main` push to `prod`
36+
# PRs to `dev` branch get deployed to `dev` environment in OpenShift
37+
# PRs to `test` get deployed to `test`
38+
# PRs to `main` get deployed to `prod`
3939
- name: Determine environment tag
4040
id: env-tag
4141
run: |
@@ -52,21 +52,13 @@ jobs:
5252
fi;
5353
shell: bash
5454

55-
- name: Build image with docker build
56-
run: docker build ./graphemes-api -f ./graphemes-api/Dockerfile -t graphemes-api:latest --build-arg GITHUB_SHA=${{ github.sha }}
57-
58-
- name: Login to OpenShift Silver image registry
59-
uses: docker/login-action@v3
55+
# Use the GHCR builder action
56+
- name: Build and push Docker image to GHCR
57+
uses: bcgov-nr/action-builder-ghcr@ace71f7a527ca6fc43c15c7806314be5a4579d2c # v.2.3.0
6058
with:
61-
registry: image-registry.apps.silver.devops.gov.bc.ca
62-
# This refers to the serviceaccount name alone, not the fully qualified
63-
# value that comes out of `oc whoami` when logged in as the SA.
64-
# Ex: For `system:serviceaccount:<name space>:<service account name>`,
65-
# just use `<service account name>`.
66-
username: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_USERNAME }}
67-
password: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_TOKEN }}
68-
69-
- name: Tag and push Docker image
70-
run: |
71-
docker tag graphemes-api:latest image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/graphemes-api:${{ env.tag }}
72-
docker push image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/graphemes-api:${{ env.tag }}
59+
package: graphemes-api
60+
tag: ${{ env.tag }}
61+
triggers: graphemes-api/**
62+
build_context: ./graphemes-api
63+
build_file: ./graphemes-api/Dockerfile
64+
keep_versions: 10

.github/workflows/graphemes_api_test.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ jobs:
2121
name: Test suite
2222
runs-on: ubuntu-latest
2323

24+
defaults:
25+
run:
26+
working-directory: ./graphemes-api
27+
2428
steps:
2529
- name: Checkout code
2630
uses: actions/checkout@v4
2731

2832
- name: Read .nvmrc
2933
run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
30-
working-directory: ./graphemes-api
3134

3235
- name: Set up Node.js
3336
uses: actions/setup-node@v4
@@ -36,14 +39,17 @@ jobs:
3639

3740
- name: Install dependencies
3841
run: npm install
39-
working-directory: ./graphemes-api
4042

41-
# Lint errors cause this job to fail
43+
# Lint errors cause this job to fail.
4244
- name: Run lint script
4345
run: npm run lint
44-
working-directory: ./graphemes-api
4546

46-
# Test failures cause this job to fail
47+
# Test failures cause this job to fail.
4748
- name: Run test script
4849
run: npm run test
49-
working-directory: ./graphemes-api
50+
51+
# Build failures cause this job to fail.
52+
# We don't care about keeping the artifact of this build,
53+
# just that it can complete.
54+
- name: Run build script
55+
run: npm run build

graphemes-api/openshift/dev/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ spec:
2424
selector:
2525
matchLabels:
2626
app: graphemes-api
27+
triggers:
28+
- type: ImageChange
29+
imageChangeParams:
30+
automatic: true
31+
containerNames:
32+
- graphemes-api
33+
from:
34+
kind: ImageStreamTag
35+
name: graphemes-api:dev
36+
namespace: f343b4-tools
2737
template:
2838
metadata:
2939
creationTimestamp: null

0 commit comments

Comments
 (0)