DPC - Build and Deploy #753
Workflow file for this run
This file contains hidden or 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: 'DPC - Build and Deploy' | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1-5' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - dpc-** | |
| - engines/** | |
| - .github/workflows/** | |
| workflow_dispatch: | |
| inputs: | |
| env: | |
| description: AWS environment to deploy to | |
| required: true | |
| type: 'string' | |
| default: 'dev' | |
| confirm_env: | |
| description: Double check for environment | |
| required: true | |
| type: 'string' | |
| default: '' | |
| ops-ref: | |
| description: Branch of dpc-ops to use | |
| required: false | |
| type: 'string' | |
| default: 'main' | |
| workflow_call: | |
| inputs: | |
| env: | |
| description: AWS environment to deploy to | |
| required: true | |
| type: 'string' | |
| default: 'dev' | |
| confirm_env: | |
| description: Double check for environment | |
| required: true | |
| type: 'string' | |
| default: '' | |
| ops-ref: | |
| description: Branch of dpc-ops to use | |
| required: false | |
| type: 'string' | |
| default: 'main' | |
| concurrency: | |
| group: release-to-${{ inputs.env || 'dev' }} | |
| cancel-in-progress: false | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| validate-parameters: | |
| name: "Validate Parameters" | |
| runs-on: codebuild-dpc-app-${{github.run_id}}-${{github.run_attempt}} | |
| outputs: | |
| version_tag: ${{ steps.get-version-tag.outputs.version_tag }} | |
| steps: | |
| - name: "Validate Environment" | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.env != inputs.confirm_env }} | |
| run: | | |
| echo "Target deployment environment \"${{ inputs.env }}\" must be specified and match confirmed deployment environment \"${{ inputs.confirm_env }}\"." | |
| exit 1 | |
| build: | |
| name: "Build Images" | |
| needs: | |
| - validate-parameters | |
| uses: ./.github/workflows/docker-build.yml | |
| with: | |
| block_release_tag: ${{ github.event_name != 'workflow_dispatch' }} | |
| secrets: inherit | |
| deploy: | |
| needs: | |
| - build | |
| uses: ./.github/workflows/ecs-deploy.yml | |
| with: | |
| env: ${{ inputs.env || 'dev' }} | |
| confirm_env: ${{ inputs.env || 'dev' }} | |
| ecr_image_tag: ${{ needs.build.outputs.ecr_image_tag }} | |
| app-version: ${{ needs.build.outputs.version_tag }} | |
| ops-ref: ${{ inputs.ops-ref || 'main' }} | |
| secrets: inherit | |
| smoke-test: | |
| needs: deploy | |
| uses: ./.github/workflows/smoke-test.yml | |
| with: | |
| env: ${{ inputs.env || 'dev' }} | |
| secrets: inherit |