doc: merge 2 doc build action files to one. #59
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
name: "build doc" | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-doc: | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message,'doc:')" | |
permissions: write-all | |
steps: | |
- name: "check out quartz custom template " | |
uses: actions/checkout@v4 | |
with: | |
repository: "nhannht/quartz" | |
fetch-depth: 0 | |
ref: v4 | |
path: quartz | |
- name: check out this repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: historica | |
- name: set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: build and deploy doc | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
run: | | |
cd quartz | |
yarn | |
yarn add wrangler | |
cp ../historica/* ./content/ -r | |
cp ../historica/quartz.config.ts ./ | |
cp ../historica/quartz.layout.ts ./ | |
cp ../historica/wrangler.toml ./ | |
npx quartz build | |
npx wrangler pages deploy --config wrangler_user_doc.toml | |
cd ../historica/ | |
yarn | |
npx typedoc | |
npx wrangler pages deploy --config wrangler_code_doc.toml | |