Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
Test _build image retagging, update template paths (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Oct 30, 2022
1 parent 86c333a commit fc65285
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ on:
template_file:
type: string
required: true
description: Template file (e.g. .github/openshift/deploy.frontend.yml)
description: Template file (e.g. frontend/openshift.deploy.yml)
template_vars:
type: string
required: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
include:
- component: database
overwrite: false
template_file: .github/openshift/deploy.database.yml
template_file: database/openshift.deploy.yml
template_vars: -p ZONE=test -p NAME=${{ github.event.repository.name }}
- component: backend
overwrite: true
template_file: .github/openshift/deploy.backend.yml
template_file: backend/openshift.deploy.yml
template_vars: -p ZONE=test -p PROMOTE=${{ github.repository }}/backend:test -p NAME=${{ github.event.repository.name }}
- component: frontend
overwrite: true
template_file: .github/openshift/deploy.frontend.yml
template_file: frontend/openshift.deploy.yml
template_vars: -p ZONE=test -p PROMOTE=${{ github.repository }}/frontend:test -p NAME=${{ github.event.repository.name }}
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
Expand All @@ -61,15 +61,15 @@ jobs:
include:
- component: database
overwrite: false
template_file: .github/openshift/deploy.database.yml
template_file: database/openshift.deploy.yml
template_vars: -p ZONE=prod -p NAME=${{ github.event.repository.name }}
- component: backend
overwrite: true
template_file: .github/openshift/deploy.backend.yml
template_file: backend/openshift.deploy.yml
template_vars: -p ZONE=prod -p PROMOTE=${{ github.repository }}/backend:test -p NAME=${{ github.event.repository.name }}
- component: frontend
overwrite: true
template_file: .github/openshift/deploy.frontend.yml
template_file: frontend/openshift.deploy.yml
template_vars: -p ZONE=prod -p PROMOTE=${{ github.repository }}/frontend:test -p NAME=${{ github.event.repository.name }}
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,29 @@ jobs:
Once merged, code will be promoted and handed off to following workflow run.
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
builds-retag:
# These build triggers won't match/fire, so images will be retagged
name: Retags
uses: ./.github/workflows/_build.yml
strategy:
matrix:
component: [backend, frontend]
include:
- component: backend
triggers: ('backend/')
- component: frontend
triggers: ('frontend/')
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
component: ${{ matrix.component }}
img_build: ${{ github.event.number }}
img_fallback: test
repository: bcgov/nr-quickstart-typescript
triggers: ${{ matrix.triggers }}

builds:
# These builds don't have triggers and will fire every time
name: Builds
uses: ./.github/workflows/_build.yml
strategy:
Expand Down Expand Up @@ -62,6 +84,7 @@ jobs:
name: Deploys
needs:
- builds
- builds-retag
- tests
# If any of the prerequs created a build, then deploy
if: contains(needs.*.outputs.build, 'true')
Expand All @@ -72,15 +95,15 @@ jobs:
include:
- component: database
overwrite: false
template_file: .github/openshift/deploy.database.yml
template_file: database/openshift.deploy.yml
template_vars: -p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
- component: backend
overwrite: true
template_file: .github/openshift/deploy.backend.yml
template_file: backend/openshift.deploy.yml
template_vars: -p ZONE=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
- component: frontend
overwrite: true
template_file: .github/openshift/deploy.frontend.yml
template_file: frontend/openshift.deploy.yml
template_vars: -p ZONE=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/frontend:${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
Expand Down

0 comments on commit fc65285

Please sign in to comment.