-
Notifications
You must be signed in to change notification settings - Fork 56
72 lines (60 loc) · 1.65 KB
/
build.yaml
File metadata and controls
72 lines (60 loc) · 1.65 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
# Workflow for build/test/docs
name: Build & Test
on:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Link
run: npm link
- name: Build
run: npm run build --if-present
- name: Test
run: npm test
# build and publish docs
docs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install
run: npm ci
- name: GH Pages
env:
# GH_PAGES_AUTH: ${{ secrets.GH_PAGES_AUTH }}
# Create a GH_PAGES_AUTH secret with format <github-username>:<github-token>
GH_PAGES_AUTH: ${{ secrets.GH_PAGES_AUTH }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
npm run docs
cd docs
git init
git config user.name "GitHub Action"
git config user.email "no-reply@oracle.com"
git checkout -b gh-pages
git remote add origin https://${GH_PAGES_AUTH}@github.com/${OWNER}/${REPO}.git
git add -A
git commit -m "Documentation Refresh"
git push origin gh-pages --force