Skip to content

Commit 5ea4a65

Browse files
committed
Use GitHub OIDC for AWS access
1 parent 39ac14b commit 5ea4a65

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- master
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
publish-web:
1014
runs-on: ubuntu-latest
@@ -18,14 +22,15 @@ jobs:
1822
- name: Render
1923
working-directory: 'site'
2024
run: hugo
25+
- name: Configure AWS Credentials
26+
uses: aws-actions/configure-aws-credentials@v4.1.0
27+
with:
28+
role-to-assume: arn:aws:iam::830482727482:role/github-workflow-java-almanac
29+
aws-region: eu-central-1
2130
- name: Upload Content
2231
run: |
2332
aws s3 sync site/public s3://javaalmanac.io/ --delete --no-progress
2433
aws cloudfront create-invalidation --distribution-id ECI1PGYSTNAWG --paths "/*"
25-
26-
env:
27-
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
28-
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
2934
3035
3136
publish-data:

0 commit comments

Comments
 (0)