Skip to content

Commit 42ad85c

Browse files
authored
Merge pull request #92 from bbc/philipn-update-static-workflow-more-fixes
gha: Add update static files workflow
2 parents 14d019a + a252961 commit 42ad85c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/shared-ext-update-static-files-workflow.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
COMMONTOOLING_DEPLOY_KEY:
1515
description: 'A deploy key that is used to fetch Commontooling'
1616
required: true
17+
AWS_ACCOUNT_ID:
18+
description: 'An AWS Account ID, used to access ECR'
19+
required: true
1720

1821
env:
1922
COMMONTOOLING_BRANCH: ${{ inputs.commontoolingBranch == '' && 'main' || inputs.commontoolingBranch }}
@@ -22,6 +25,7 @@ jobs:
2225
UpdateStaticFiles:
2326
permissions:
2427
contents: read
28+
id-token: write
2529
runs-on: ubuntu-22.04
2630
environment:
2731
name: update-static-files
@@ -32,6 +36,13 @@ jobs:
3236
fetch-depth: 1
3337
ssh-key: ${{ secrets.WRITE_ACCESS_DEPLOY_KEY }}
3438

39+
- name: Configure AWS Credentials
40+
uses: aws-actions/configure-aws-credentials@v4
41+
with:
42+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/gha_ecr_public_read
43+
role-session-name: GitHub_to_AWS_via_FederatedOIDC
44+
aws-region: us-east-1
45+
3546
- name: Login to Amazon ECR
3647
id: login-ecr
3748
uses: aws-actions/amazon-ecr-login@v2

.github/workflows/update-static-files-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
name: Shared Workflow
1515
permissions:
1616
contents: read
17+
id-token: write
1718
# Github Actions doesn't allow the use of parameters in `uses` statements. If you want to use a different shared workflow branch, change it here
1819
uses: ./.github/workflows/shared-ext-update-static-files-workflow.yml
1920
with:

0 commit comments

Comments
 (0)