Skip to content

Commit

Permalink
ci: automate generating and deploying documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 6, 2022
1 parent 1246e01 commit e2a0d4e
Showing 1 changed file with 70 additions and 2 deletions.
72 changes: 70 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ jobs:
path: |
./node_modules/
./build/
key: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}"
key: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}"
restore-keys: |
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}-"
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version }}-"
- name: Setup Cpp
if: ${{ !matrix.docker }}
Expand Down Expand Up @@ -160,3 +160,71 @@ jobs:
run: |
pnpm run clean
pnpm run test
Docs:
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
node_version:
- 18
node_arch:
- x64
cpp_arch:
- x64
ARCH:
- x64
zmq_draft:
- false
env:
ZMQ_DRAFT: ${{ matrix.zmq_draft }}
ZMQ_SHARED: false
ARCH: ${{ matrix.ARCH }}

steps:
- uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v3
with:
path: |
./node_modules/
./build/
key: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}"
restore-keys: |
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version }}-"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
cmake: true
architecture: ${{ matrix.cpp_arch }}

- uses: pnpm/action-setup@v2.2.4
with:
version: 7

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.node_arch }}
cache: "pnpm"

- name: Build Documentation
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
run: |
pnpm install
pnpm run build.doc
- name: Deploy Documentation
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
uses: Cecilapp/GitHub-Pages-deploy@v3
with:
build_dir: docs
branch: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e2a0d4e

Please sign in to comment.