-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (41 loc) · 1.39 KB
/
owlet.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
name: Owlet CI and CD
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: make check
deploy-code:
needs: build-and-test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: make dist
- name: upload distribution to s3
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks --exclude index.html
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: "us-east-1"
SOURCE_DIR: "dist"
- name: upload new index.html to s3 (with cache control magic)
uses: jakejarvis/[email protected]
with:
args: --acl public-read --exclude '*' --include index.html --cache-control max-age=0 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: "us-east-1"
SOURCE_DIR: "dist"