From 8a8516ae9a8c65b28611995674f37c6e20b30e07 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 11 Mar 2024 22:24:11 -0700 Subject: [PATCH] Update prod release workflow --- .github/workflows/prod.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 1ff88f9e..c2b134cb 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -1,6 +1,8 @@ -name: Prod Deploy +name: PROD Release on: + release: + types: [published] workflow_dispatch: concurrency: @@ -8,6 +10,18 @@ concurrency: cancel-in-progress: true jobs: + vars: + name: Set Variables + outputs: + pr: ${{ steps.pr.outputs.pr }} + runs-on: ubuntu-22.04 + timeout-minutes: 1 + 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: PROD Deployments environment: prod @@ -18,10 +32,8 @@ jobs: include: - name: frontend file: frontend/openshift.nginx.deploy.yml - overwrite: true - name: rctool file: frontend/openshift.deploy.yml - overwrite: true steps: - uses: bcgov-nr/action-deployer-openshift@v2.1.0 with: @@ -29,24 +41,25 @@ jobs: oc_namespace: ${{ secrets.OC_NAMESPACE }} oc_server: ${{ secrets.OC_SERVER }} oc_token: ${{ secrets.OC_TOKEN }} - overwrite: ${{ matrix.overwrite }} + overwrite: true parameters: -p ZONE=prod -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test - -p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }} - penetration_test: false image-promotions: - name: Promote images to PROD - needs: - - deploys + name: Promote Images + needs: [vars, deploys] + permissions: + packages: write runs-on: ubuntu-22.04 strategy: matrix: - component: [frontend, rctool] + package: [frontend, rctool] + timeout-minutes: 1 steps: - uses: shrink/actions-docker-registry-tag@v4 with: registry: ghcr.io - repository: ${{ github.repository }}/${{ matrix.component }} + repository: ${{ github.repository }}/${{ matrix.package }} target: test tags: prod + target: ${{ needs.vars.outputs.pr }}