-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.8 KB
/
flush-caches.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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}