Skip to content

chore(ci): dial up TEST and PROD DB PVCs (#1509) #513

chore(ci): dial up TEST and PROD DB PVCs (#1509)

chore(ci): dial up TEST and PROD DB PVCs (#1509) #513

Workflow file for this run

name: Merge
on:
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- '.github/graphics/**'
- '!.github/workflows/**'
concurrency:
# Do not interrupt previous workflows
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
init:
name: Initialize
outputs:
pr: ${{ steps.pr.outputs.pr }}
runs-on: ubuntu-latest
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
uses: bcgov-nr/action-get-pr@v0.0.1
deploys:
name: TEST
needs: [init]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
with:
environment: test
tag: ${{ needs.init.outputs.pr }}
target: test
promote:
name: Promote Images
env:
target: ${{ needs.init.outputs.pr }}
tag: prod
needs: [init, deploys]
runs-on: ubuntu-latest
strategy:
matrix:
package: [backend, common, database, frontend, oracle-api, sync]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ env.target }}
tags: ${{ env.tag }}
- run: |
# Verify tagging
INSPECT="docker manifest inspect ghcr.io/${{ github.repository }}/${{ matrix.package }}"
TARGET=$(${INSPECT}:${{ env.target }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
TAG=$(${INSPECT}:${{ env.tag }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
echo "TARGET: ${TARGET}"
echo "TAG: ${TAG}"
if [ "${TARGET}" != "${TAG}" ]; then
echo "ERROR: Tagging failed!"
echo "RETRY=true" >> $GITHUB_ENV
else
echo "ERROR: Tagging success!"
echo "RETRY=false" >> $GITHUB_ENV
fi