Flush caches for prod
environment
#554
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: Flush Caches Workflow | |
run-name: Flush caches for `${{ inputs.environment }}` environment | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
required: true | |
type: choice | |
description: Select a well known environment to flush all caches for. | |
options: | |
- prod | |
- dev | |
- dpd | |
- test | |
- staging | |
env: | |
AWS_REGION: "eu-west-2" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
flush_caches: | |
name: Flush caches | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-terraform | |
- uses: ./.github/actions/setup-zsh | |
- name: Configure AWS credentials for tools account | |
uses: ./.github/actions/configure-aws-credentials | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
tools-account-role: ${{ secrets.UHD_TERRAFORM_IAM_ROLE }} | |
- name: Terraform output | |
run: | | |
source uhd.sh | |
uhd terraform init:layer 20-app | |
uhd terraform output ${{ inputs.environment }} | |
shell: zsh {0} | |
- name: Configure AWS credentials for account | |
uses: ./.github/actions/configure-aws-credentials | |
with: | |
account-name: ${{ inputs.environment }} | |
aws-region: ${{ env.AWS_REGION }} | |
prod-account-role: ${{ secrets.UHD_TERRAFORM_ROLE_PROD }} | |
dev-account-role: ${{ secrets.UHD_TERRAFORM_ROLE_DEV }} | |
test-account-role: ${{ secrets.UHD_TERRAFORM_ROLE_TEST }} | |
uat-account-role: ${{ secrets.UHD_TERRAFORM_ROLE_UAT }} | |
- name: Flush caches | |
run: | | |
source uhd.sh | |
uhd cache flush | |
shell: zsh {0} | |
- name: Restart front end | |
run: | | |
source uhd.sh | |
uhd ecs restart-containers front_end | |
shell: zsh {0} |