-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1207 from UKHSA-Internal/task/add-workflow-to-flu…
…sh-personal-dev-env-caches/CDD-2448 Task/add workflow to flush personal dev env caches/cdd 2448
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
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
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} |
4 changes: 2 additions & 2 deletions
4
.github/workflows/flush-caches.yml → ...s/flush-caches-well-known-environment.yml
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