This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
Deploy to AWS #21
Workflow file for this run
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: Deploy to AWS | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Which AWS Account to use | |
type: choice | |
required: true | |
options: | |
- dev | |
- test | |
- uat | |
- production | |
run_performance_tests: | |
required: false | |
default: false | |
type: boolean | |
description: Run performance tests | |
run_e2e_tests: | |
required: false | |
default: true | |
type: boolean | |
description: Run e2e tests | |
push: | |
# Ignore README markdown | |
# Only automatically deploy when something in the app or tests folder has changed | |
# paths: | |
# - '!**/README.md' | |
# - 'app/**' | |
# - 'tests/**' | |
jobs: | |
paketo_build: | |
permissions: | |
packages: write | |
uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@main | |
with: | |
version_to_build: $(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
owner: ${{ github.repository_owner }} | |
application: funding-service-design-fund-store | |
pre_deploy_tests: | |
secrets: | |
E2E_PAT: ${{secrets.E2E_PAT}} | |
uses: communitiesuk/funding-service-design-workflows/.github/workflows/pre-deploy.yml@main | |
with: | |
# Note - no db-name, so defaults to postgres_db | |
postgres_unit_testing: true | |
copilot_deploy_dev: | |
if: inputs.environment == 'dev' || inputs.environment == '' | |
needs: [pre_deploy_tests, paketo_build] | |
concurrency: deploy-dev | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
secrets: | |
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | |
uses: ./.github/workflows/environment.yml | |
with: | |
workspace: 'dev' | |
copilot_deploy_test: | |
if: inputs.environment == 'test' || inputs.environment == '' | |
needs: [pre_deploy_tests, paketo_build] | |
concurrency: deploy-test | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
secrets: | |
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | |
uses: ./.github/workflows/environment.yml | |
with: | |
workspace: 'test' | |
# Allow the capability to override UAT with another branch, but ideally uat and production should be in sync as much as possible | |
copilot_deploy_uat: | |
if: inputs.environment == 'uat' || inputs.environment == '' | |
needs: [pre_deploy_tests, paketo_build] | |
concurrency: deploy-uat | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
secrets: | |
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | |
uses: ./.github/workflows/environment.yml | |
with: | |
workspace: 'uat' | |
# Only run this if the branch being deployed is main | |
copilot_deploy_production: | |
if: (inputs.environment == 'production' || inputs.environment == '') && github.ref == 'refs/heads/main' | |
needs: [pre_deploy_tests, paketo_build] | |
concurrency: deploy-production | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
secrets: | |
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | |
uses: ./.github/workflows/environment.yml | |
with: | |
workspace: 'production' | |
# Can we realistically run E2E at this stage, or just plump for application on the grounds it checks fund-store is operational? | |
post_deploy_tests: | |
needs: copilot_deploy_test | |
secrets: | |
E2E_PAT: ${{secrets.E2E_PAT}} | |
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main | |
with: | |
run_performance_tests: ${{ inputs.run_performance_tests }} | |
run_e2e_tests: ${{ inputs.run_e2e_tests }} | |
app_name: application |