File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Test S3 Deploy
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+ permissions :
9+ id-token : write
10+
11+ jobs :
12+ deploy-s3 :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Create OIDC token to AWS
16+ uses : aws-actions/configure-aws-credentials@v4
17+ with :
18+ audience : sts.amazonaws.com
19+ aws-region : us-east-1
20+ role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/${{ secrets.CI_IAM_ROLE }}
21+ - name : Push to AWS S3
22+ run : |
23+ mkdir dist
24+ printf "<h1>CloudFront deployment with GitHub Actions</h1>" > dist/index.html
25+ aws s3 cp dist s3://${{ secrets.APP_BUCKET }} --recursive
26+ aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > Document</ title >
7+ </ head >
8+ < body >
9+ < h1 > Hello World</ h1 >
10+ </ body >
11+ </ html >
You can’t perform that action at this time.
0 commit comments