We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50656e1 commit baaca73Copy full SHA for baaca73
1 file changed
.github/workflows/deploy.yml
@@ -0,0 +1,33 @@
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 }}
0 commit comments