forked from parse-community/Parse-SDK-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.13 KB
/
pages.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
name: docs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-18.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.14'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get Tag
uses: actions/github-script@v3
id: tag
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const ref = process.env.GITHUB_REF
if(!ref.startsWith('refs/tags/'))
return ''
return ref.replace(/^refs\/tags\//, '')
- name: Generate Docs
run: |
echo $SOURCE_TAG
npm ci
npm run release_docs
env:
SOURCE_TAG: ${{ steps.tag.outputs.result }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs