Skip to content

Commit

Permalink
ci(docs): update document building workflow [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Aug 22, 2024
1 parent 014a639 commit 4af17f5
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ on:
push:
tags:
- "*"
workflow_dispatch:

jobs:
Docs:
if:
"startsWith(github.ref, 'refs/tags/') &&
!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -21,14 +19,12 @@ jobs:
- x64
cpp_arch:
- x64
ARCH:
- x64
zmq_draft:
- false
env:
ZMQ_DRAFT: ${{ matrix.zmq_draft }}
ZMQ_SHARED: false
ARCH: ${{ matrix.ARCH }}
npm_config_zmq_draft: false
npm_config_zmq_shared: false
npm_config_arch: ${{ matrix.node_arch }}
npm_config_target_arch: ${{ matrix.node_arch }}
setup_node_arch: ${{ matrix.node_arch }}

steps:
- uses: actions/checkout@v4
Expand All @@ -40,40 +36,46 @@ jobs:
./node_modules/
./build/
key:
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch
}}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version
}}-${{ hashFiles('./package.json') }}"
# prettier-ignore
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-ZMQ_DRAFT:${{env.npm_config_zmq_draft }}-Node:${{ matrix.node_version}}-${{hashFiles('./package.json') }}-docs"
restore-keys: |
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-Node:${{ matrix.node_version }}-"
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ env.npm_config_zmq_draft }}-Node:${{ matrix.node_version }}-"
- name: Env map
run: |
if [ "${{ matrix.node_arch }}" = "ia32" ]; then
echo "setup_node_arch=x86" > $GITHUB_ENV
fi
shell: bash

- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
python: true
architecture: ${{ matrix.cpp_arch }}

- uses: pnpm/action-setup@v4
with:
version: 7
version: 9

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

- 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
email: ${{ github.actor }}@users.noreply.github.com
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4af17f5

Please sign in to comment.