-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (34 loc) · 1.07 KB
/
gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: GitHub Pages
on:
push:
branches:
- main
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build:prod
- name: Deploy
run: aws s3 rm s3://${{ secrets.AWS_S3_BUCKET_NAME }} --recursive && aws s3 sync ./dist/zapddit/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}
- name: "Create AWS Cloudfront Invalidation"
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
# - name: Deploy
# if: success()
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.ZAPPEDIT_TOKEN }}
# publish_dir: dist/zapddit
# enable_jekyll: true