mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 01:14:36 +00:00
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Generate docs and Push to docs Branch
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
generate_and_push_docs:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [lts/hydrogen]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
# 2. Restore npm cache manually
|
|
- name: Restore npm cache
|
|
uses: actions/cache@v3
|
|
id: npm-cache
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Ensure docs folder exists
|
|
run: |
|
|
rm -rf docs || true # avoid error if docs folder does not exist
|
|
mkdir docs
|
|
|
|
- name: Generate Docs
|
|
run: npm run typedoc
|
|
|
|
- name: Push generated docs
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_branch: gh-pages
|
|
publish_dir: ./docs
|
|
cname: adapter.sasjs.io
|
|
|