CI/CD snapshot update (PreProd) #29
This file contains hidden or 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: "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: "Folder to use for results and references" | |
| required: true | |
| type: choice | |
| options: | |
| - release1 | |
| - latest-main-tag | |
| 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" | |
| 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/snapshots-for-review/${{ inputs.release_version }}/${{ inputs.tag }}/ s3://${{ env.AWS_S3_ARTEFACTS_BUCKET }}/playwright/reference/${{ inputs.release_version }}/__snapshots__/ |