-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (45 loc) · 1.24 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
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy result to site'
required: false
default: 'false'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install dependencies
uses: Borales/[email protected]
with:
cmd: install
- name: Test
uses: Borales/[email protected]
with:
cmd: test:unit
- name: Build for production
uses: Borales/[email protected]
with:
cmd: build
- name: Deploy
uses: maxheld83/[email protected]
if: (github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[deploy]'))
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true')
env:
GH_PAT: ${{ secrets.GH_PAT }}
BUILD_DIR: dist/