forked from rei/rei-cedar
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.52 KB
/
main.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
60
61
62
63
64
name: Main
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
env:
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_GIT_URL: ${{ secrets.HEROKU_GIT_URL }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
- name: Write auth
run: |
cat > ~/.netrc <<EOF
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
- name: Git push to Heroku for deploy
run: |
git remote add heroku $HEROKU_GIT_URL
git push heroku main
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Use actions/checkout@v2
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Handle Cache
uses: actions/cache@v2
id: cache
with:
path: |
node_modules
**/node_modules
~/.npm
key: node-deps-${{ hashFiles('package-lock.json') }}
- name: Install Deps
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
env:
CYPRESS_INSTALL_BINARY: 0
- name: Run Full Build
run: npm run build
- name: Run Knapsack Test
run: npm run ks:test