Skip to content

Commit

Permalink
Merge pull request #1207 from UKHSA-Internal/task/add-workflow-to-flu…
Browse files Browse the repository at this point in the history
…sh-personal-dev-env-caches/CDD-2448

Task/add workflow to flush personal dev env caches/cdd 2448
  • Loading branch information
A-Ashiq authored Jan 28, 2025
2 parents a24fd9b + 6fa815c commit d916999
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/flush-caches-dev-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Flush Caches Development Environment Workflow
run-name: Flush caches for `${{ inputs.environment }}` development environment

on:
workflow_dispatch:
inputs:
environment:
required: true
type: string
description: Select a personal development environment to flush all caches for.

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: "dev"
aws-region: ${{ env.AWS_REGION }}
dev-account-role: ${{ secrets.UHD_TERRAFORM_ROLE_DEV }}

- 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}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Flush Caches Workflow
run-name: Flush caches for `${{ inputs.environment }}` environment
name: Flush Caches Well-Known Environment Workflow
run-name: Flush caches for `${{ inputs.environment }}` WKE environment

on:
workflow_dispatch:
Expand Down

0 comments on commit d916999

Please sign in to comment.