Skip to content

Commit

Permalink
ci: restore main merge overwrites, shuffle image promotions (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Nov 8, 2023
1 parent 3904fb6 commit 4bc6355
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
name: [database, backend, frontend]
include:
- name: database
overwrite: false
- name: backend
verification_path: actuator/health
- name: frontend
Expand All @@ -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 }}
Expand All @@ -99,16 +100,34 @@ 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:
matrix:
name: [database, backend, frontend]
include:
- name: database
overwrite: false
- name: backend
verification_path: actuator/health
- name: frontend
Expand All @@ -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
2 changes: 1 addition & 1 deletion database/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ objects:
selector:
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
sessionAffinity: None
type: ClusterIP
type: ClusterIP

0 comments on commit 4bc6355

Please sign in to comment.