From 4bc63550194538eb411c7094a1176e3524729a04 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 7 Nov 2023 18:02:33 -0800 Subject: [PATCH] ci: restore main merge overwrites, shuffle image promotions (#136) --- .github/workflows/merge.yml | 42 ++++++++++++++++++----------------- database/openshift.deploy.yml | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 0dee1513..faffe4c6 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -62,6 +62,7 @@ jobs: name: [database, backend, frontend] include: - name: database + overwrite: false - name: backend verification_path: actuator/health - name: frontend @@ -75,7 +76,7 @@ jobs: oc_namespace: ${{ vars.OC_NAMESPACE }} oc_server: ${{ vars.OC_SERVER }} oc_token: ${{ secrets.OC_TOKEN }} - overwrite: true + overwrite: ${{ matrix.overwrite }} parameters: -p ZONE=test -p NAME=${{ github.event.repository.name }} @@ -99,9 +100,26 @@ jobs: parameters: -p ZONE=prod -p NAME=${{ github.event.repository.name }} + image-promotions: + name: Promote images to PROD + needs: [deploys-test] + runs-on: ubuntu-22.04 + permissions: + packages: write + strategy: + matrix: + component: [database, backend, frontend] + steps: + - uses: shrink/actions-docker-registry-tag@v3 + with: + registry: ghcr.io + repository: ${{ github.repository }}/${{ matrix.component }} + target: test + tags: prod + deploys-prod: name: PROD Deployments - needs: [init-prod] + needs: [init-prod, image-promotions] environment: prod runs-on: ubuntu-22.04 strategy: @@ -109,6 +127,7 @@ jobs: name: [database, backend, frontend] include: - name: database + overwrite: false - name: backend verification_path: actuator/health - name: frontend @@ -122,26 +141,9 @@ jobs: oc_namespace: ${{ vars.OC_NAMESPACE }} oc_server: ${{ vars.OC_SERVER }} oc_token: ${{ secrets.OC_TOKEN }} - overwrite: true + overwrite: ${{ matrix.overwite }} parameters: -p ZONE=prod -p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }} verification_path: ${{ matrix.verification_path }} - - image-promotions: - name: Promote images to PROD - needs: [deploys-prod] - runs-on: ubuntu-22.04 - permissions: - packages: write - strategy: - matrix: - component: [database, backend, frontend] - steps: - - uses: shrink/actions-docker-registry-tag@v3 - with: - registry: ghcr.io - repository: ${{ github.repository }}/${{ matrix.component }} - target: test - tags: prod diff --git a/database/openshift.deploy.yml b/database/openshift.deploy.yml index 4d05aaba..3d3ef418 100644 --- a/database/openshift.deploy.yml +++ b/database/openshift.deploy.yml @@ -182,4 +182,4 @@ objects: selector: deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} sessionAffinity: None - type: ClusterIP \ No newline at end of file + type: ClusterIP