generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (40 loc) · 1.36 KB
/
cicd-6-snapshot-update.yaml
File metadata and controls
45 lines (40 loc) · 1.36 KB
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
name: "CI/CD snapshot update (PreProd)"
on:
workflow_dispatch:
inputs:
tag:
description: "Datetime and version of snapshots to set as reference"
required: true
type: string
release_version:
description: "Release to update references for (R1 or R2)"
required: true
type: choice
options:
- v0
- v1
- v2
env:
AWS_REGION: eu-west-2
AWS_S3_ARTEFACTS_BUCKET: vita-${{ secrets.AWS_ACCOUNT_ID }}-artefacts-preprod
jobs:
upload-snapshots:
name: "Update Snapshots in S3"
runs-on: ubuntu-latest
environment: preprod
timeout-minutes: 10
permissions:
id-token: write
contents: read
env:
IAM_ROLE: ${{ secrets.IAM_ROLE }}
steps:
- name: "Configure AWS credentials for S3 upload"
uses: aws-actions/configure-aws-credentials@v5
with:
role-session-name: GitHubActionsSessionUpload
role-to-assume: ${{ env.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: "Set ${{inputs.release_version}} reference to ${{ inputs.tag }} tagged snapshots"
run: |
aws s3 sync --delete s3://${{ env.AWS_S3_ARTEFACTS_BUCKET }}/playwright/${{inputs.release_version}}/${{ inputs.tag }}/ s3://${{ env.AWS_S3_ARTEFACTS_BUCKET }}/playwright/reference/__snapshots__/${{inputs.release_version}}/