-
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.48 KB
/
preview.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
name: Preview
on:
pull_request:
paths:
- package.json
- yarn.lock
- .github/workflows/preview.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "12"
- uses: actions/[email protected]
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install all node packages
run: |
npm install
- name: Run test all
run: |
npm run test:all
- name: Run check all
run: |
npm run check:all
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event.ref == 'refs/heads/master')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_API }}
with:
channel: '#api'
status: ${{ job.status }}
fields: job,commit,ref,eventName,author,took
author_name: [email protected]
- name: Start development server
run: |
npm run develop &
- name: Test development server
run: |
curl --retry-connrefused --retry 5 http://localhost:3000/
curl --fail http://localhost:3000/api?theme=default_repocard&layout=churchill > /dev/null