File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to S3
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : Setup Node.js
15+ uses : actions/setup-node@v4
16+ with :
17+ node-version : ' 18'
18+ cache : ' npm'
19+
20+ - name : Install dependencies
21+ run : npm ci
22+
23+ - name : Build
24+ run : npm run build
25+
26+ - name : Deploy to S3
27+ run : |
28+ aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete
29+ aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
30+ env :
31+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
32+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33+ AWS_DEFAULT_REGION : ${{ secrets.AWS_REGION }}
You can’t perform that action at this time.
0 commit comments