-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (35 loc) · 1.01 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version: 20.10.0
- name: Install and Build
run: |
npm install
npm run build
cp dist/index.html dist/404.html
- name: Deploy S3 Production
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
AWS_REGION: us-west-2
if: github.ref == 'refs/heads/main'
run: |
aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }}
- name: Deploy Github Pages
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/main'
with:
branch: gh-pages
folder: dist