-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (54 loc) · 1.87 KB
/
test.yaml
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
name: Run tests
on:
push:
pull_request:
release:
types: [released]
jobs:
buildtest:
name: Lint, build and test
strategy:
matrix:
node: [12.x, 14.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v1
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npx eslint --max-warnings 0 "**"
- run: npx next build
- run: npx next export
- name: Archive static site
uses: actions/upload-artifact@v1
with:
name: static-site-${{matrix.os}}-${{matrix.node}}
path: out
- name: Deploy to staging with rsync
uses: easingthemes/ssh-deploy@7f1c0e0111a1faab7ac49ad2561bdac24d482d74
if: ${{ success() &&
github.event_name == 'push' && github.ref == 'refs/heads/main' &&
matrix.os == 'ubuntu-latest' && matrix.node == '14.x' }}
env:
REMOTE_HOST: "sidewalk-obstruction-bingo-staging.yasskin.info"
REMOTE_USER: "sidewalkbingo"
SSH_PRIVATE_KEY: ${{ secrets.STAGING_SSH_KEY }}
SOURCE: "out/"
TARGET: "/home/sidewalkbingo/sidewalk-obstruction-bingo-staging.yasskin.info"
ARGS: "-avzyc --no-g --delete-delay --chmod=ug=rwX,o=rX"
- name: Push to gh-pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ success() &&
github.event_name == 'release' &&
matrix.os == 'ubuntu-latest' && matrix.node == '14.x' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
cname: sidewalk-obstruction-bingo.oregonwalks.org
#- run: npm run test:ci