-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (92 loc) · 2.79 KB
/
main.yml
File metadata and controls
102 lines (92 loc) · 2.79 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: yarn install, yarn dev, yarn test
run: |
yarn
yarn global add lerna
./node_modules/lerna/cli.js bootstrap
yarn dev
yarn test
yarn jsdoc
- name: Upload docs for job:build
uses: actions/upload-artifact@v1
with:
name: docs
path: docs
publish:
if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
name: 'Publish to Netlify'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download docs for job:build
uses: actions/download-artifact@v1
with:
name: docs
- name: 'Upload to netlify'
uses: netlify/actions/cli@master
with:
args: deploy --prod --dir=docs/js/0.1.1
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docsearch:
if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
needs: publish
name: Update docsearch indices
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pipenv
run: pip install --upgrade pipenv
- name: Setup docsearch scrapper
uses: actions/checkout@v2
with:
repository: softvar/docsearch-scraper
ref: master
- name: Install deps
run: pipenv install
- name: Run docsearch to update indices
run: pipenv run ./docsearch run config.json