Skip to content

Commit

Permalink
chore(ci): restore PROD in main merge (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Aug 26, 2024
1 parent f1f83d1 commit 4a9c59c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ jobs:
runs-on: ubuntu-latest
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
- id: pr
uses: bcgov-nr/[email protected]

deploys:
name: TEST
deploys-test:
name: TEST Deploys (${{ needs.init.outputs.pr }})
needs: [init]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
Expand All @@ -36,12 +35,19 @@ jobs:
tag: ${{ needs.init.outputs.pr }}
target: test

deploys-prod:
name: PROD Deploys (${{ needs.init.outputs.pr }})
needs: [init, deploys-test]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
with:
environment: prod
tag: ${{ needs.init.outputs.pr }}
target: prod

promote:
name: Promote Images
env:
target: ${{ needs.init.outputs.pr }}
tag: prod
needs: [init, deploys]
needs: [init, deploys-prod]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -51,20 +57,5 @@ jobs:
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
target: ${{ needs.init.outputs.pr }}
tags: prod
2 changes: 1 addition & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
triggers: ('${{ matrix.package }}/')

deploys:
name: Deploys
name: Deploys (${{ github.event.number }})
needs: [builds]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
Expand Down

0 comments on commit 4a9c59c

Please sign in to comment.