Merge pull request #50 from oracle/documentation-updates #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 "[email protected]" | |
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 |