Skip to content

Commit 3d61844

Browse files
committed
add (testS3deploy-ci)
1 parent eb46986 commit 3d61844

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/testS3Deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 "/*"

cloudFrontSetUp/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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>

0 commit comments

Comments
 (0)