-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.71 KB
/
build-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and deploy web app
on: [push]
jobs:
build:
name: Build React app
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install Yarn dependencies
run: yarn install --immutable
- name: Build React app
run: yarn build
env:
PUBLIC_URL: https://pass.wayspace.net
- name: Save build output
uses: actions/upload-artifact@v4
with:
name: app-build-out
path: build
deploy:
name: Deploy static app to S3
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore build output
uses: actions/download-artifact@v4
with:
name: app-build-out
path: build
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Upload to AWS S3
run: aws s3 sync build s3://pass.wayspace.net --delete