Skip to content

Commit

Permalink
ci: add docs build test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Dec 19, 2023
1 parent 1e34c62 commit c228388
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 15 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/docs-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,16 @@ jobs:
runs-on: ubuntu-latest

steps:
# - name: Wait for other docs build to succeed
# uses: lewagon/[email protected]
# with:
# running-workflow-name: 'Docs CN Mirror Deploy'
# check-name: 'Build Docs'
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# allowed-conclusions: success,skipped,cancelled
# wait-interval: 10

- name: Checkout
uses: actions/checkout@v3

- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Docs

on:
pull_request:
branches:
- master
paths:
- "docs/**"
push:
branches:
- "!master"
paths:
- "docs/**"

jobs:
deploy:
strategy:
matrix:
node: [18, 20]
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build Docs
run: pnpm docs:build
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"homepage": "https://artalk.js.org",
"scripts": {
"docs:build": "pnpm -filter=docs-landing build && pnpm -r swagger:build && pnpm -r docs:build"
}
},
"packageManager": "[email protected]"
}

0 comments on commit c228388

Please sign in to comment.