From 543da3c09da1d146574a7f3cd58c02db5cf378c3 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 3 Oct 2024 11:20:24 -0700 Subject: [PATCH] fix(ci): promote images to prod (#292) * fix(ci): promote images to prod * Removed one more PROMOTE var --- .github/openshift/deploy.backend.yml | 3 --- .github/workflows/merge-main.yml | 20 ++++++++++++++------ .github/workflows/pr-open.yml | 1 - 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/openshift/deploy.backend.yml b/.github/openshift/deploy.backend.yml index 2331edd..442298e 100644 --- a/.github/openshift/deploy.backend.yml +++ b/.github/openshift/deploy.backend.yml @@ -26,9 +26,6 @@ parameters: - name: ORG description: Organization name value: bcgov - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/nr-old-growth:prod-backend - name: CHES_CLIENT_ID description: CHES service client id required: true diff --git a/.github/workflows/merge-main.yml b/.github/workflows/merge-main.yml index 14939b0..278054a 100644 --- a/.github/workflows/merge-main.yml +++ b/.github/workflows/merge-main.yml @@ -21,7 +21,6 @@ jobs: #TODO: check sonar for OG tests-backend: name: Backend Unit Tests - if: github.event_name != 'pull_request' || !github.event.pull_request.draft runs-on: ubuntu-24.04 continue-on-error: true steps: @@ -109,7 +108,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p PROMOTE=${{ github.repository }}/backend:${{ env.ZONE }} -p CHES_CLIENT_ID=${{ secrets.CHES_CLIENT_ID }} -p CHES_CLIENT_SECRET=${{ secrets.CHES_CLIENT_SECRET }} -p CHES_TOKEN_URL='https://test.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' @@ -118,12 +116,24 @@ jobs: -p BCEID_FORM_PASSWORD=${{ secrets.CHEFS_BCEID_FORM_PASSWORD}} -p IDIR_FORM_PASSWORD=${{ secrets.CHEFS_IDIR_FORM_PASSWORD}} + prod-promotions: + name: Promote Images to Prod + needs: + - deploy-test-backend + runs-on: ubuntu-24.04 + steps: + - uses: shrink/actions-docker-registry-tag@v4 + with: + registry: ghcr.io + repository: ${{ github.repository }}/backend + target: test + tags: prod + deploy-prod-database: name: Deploy Database on Prod Env needs: - - deploy-test-backend + - prod-promotions env: - PREV: test ZONE: prod environment: prod runs-on: ubuntu-24.04 @@ -145,7 +155,6 @@ jobs: needs: - deploy-prod-database env: - PREV: test ZONE: prod environment: prod runs-on: ubuntu-24.04 @@ -162,7 +171,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p PROMOTE=${{ github.repository }}/backend:${{ env.PREV }} -p CHES_CLIENT_ID=${{ secrets.CHES_CLIENT_ID }} -p CHES_CLIENT_SECRET=${{ secrets.CHES_CLIENT_SECRET }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index e84faa0..de122cf 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -150,7 +150,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }} - -p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }} -p CHES_CLIENT_ID=${{ secrets.CHES_CLIENT_ID }} -p CHES_CLIENT_SECRET=${{ secrets.CHES_CLIENT_SECRET }} -p CHES_TOKEN_URL='https://dev.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token'