CDPT- 1855: Update docs (#296) #327
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Justice.Gov.UK -- Deployment" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'frontend-rework' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
image: | |
name: "Image" | |
if: ${{ (github.event.ref == 'refs/heads/main') || (github.event.ref == 'refs/heads/frontend-rework') }} | |
uses: ./.github/workflows/build.yml | |
secrets: inherit | |
modsec_config: | |
name: "Modsec" | |
if: ${{ (github.event.ref == 'refs/heads/main') || (github.event.ref == 'refs/heads/frontend-rework') }} | |
uses: ./.github/workflows/modsec-config.yml | |
secrets: inherit | |
deploy_dev: | |
name: "Development" | |
if: github.event.ref == 'refs/heads/main' | |
uses: ./.github/workflows/deploy.yml | |
needs: [image, modsec_config] | |
with: | |
environment: development | |
registry: ${{ needs.image.outputs.registry }} | |
modsec_config: ${{ needs.modsec_config.outputs.development }} | |
secrets: inherit | |
deploy_demo: | |
name: "Demo" | |
# revert needs to include deploy_dev and if to " "/heads/main once fe rework is merged to main | |
# TODO: remember to update demo environment allowed branches on GitHub too | |
needs: [image, modsec_config] | |
if: github.event.ref == 'refs/heads/frontend-rework' | |
uses: ./.github/workflows/deploy.yml | |
with: | |
environment: demo | |
registry: ${{ needs.image.outputs.registry }} | |
modsec_config: ${{ needs.modsec_config.outputs.demo }} | |
secrets: inherit | |
deploy_staging: | |
name: "Staging" | |
needs: [image, modsec_config, deploy_dev] | |
if: github.event.ref == 'refs/heads/main' | |
uses: ./.github/workflows/deploy.yml | |
with: | |
environment: staging | |
registry: ${{ needs.image.outputs.registry }} | |
modsec_config: ${{ needs.modsec_config.outputs.staging }} | |
secrets: inherit | |
deploy_production: | |
name: "Production" | |
needs: [image, modsec_config, deploy_staging] | |
if: github.event.ref == 'refs/heads/main' | |
uses: ./.github/workflows/deploy.yml | |
with: | |
environment: production | |
registry: ${{ needs.image.outputs.registry }} | |
modsec_config: ${{ needs.modsec_config.outputs.production }} | |
secrets: inherit | |