-
Notifications
You must be signed in to change notification settings - Fork 13
35 lines (32 loc) · 1.01 KB
/
build.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
name: Build
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Infer node version from .nvmrc, courtesy of https://github.com/actions/setup-node/issues/32#issuecomment-539794249
- name: Read .nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- name: Install dependencies
run: yarn
- name: Build
run: yarn run build
- name: Test
run: yarn run test
- name: Set up pages
run: mkdir pages && cp -r dist/* pages/ && cp index.html pages/
- name: Deploy Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages # The branch the action should deploy to.
folder: pages # The folder the action should deploy.