2024-09-04 16:52:37 +08:00
|
|
|
name: Deploy GitBook with GitHub Pages dependencies preinstalled
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- 'docs/**'
|
2024-09-04 16:57:44 +08:00
|
|
|
- '.github/workflows/wiki.yml'
|
2024-09-04 16:52:37 +08:00
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v5
|
|
|
|
- name: Setup Node.js environment
|
|
|
|
uses: actions/setup-node@v4.0.3
|
2024-09-04 16:55:43 +08:00
|
|
|
with:
|
|
|
|
node-version: '10.21.0'
|
2024-09-04 16:52:37 +08:00
|
|
|
- name: Install gitbook-cli
|
|
|
|
run: |
|
|
|
|
npm install -g gitbook-cli
|
|
|
|
- name: Build with gitbook
|
|
|
|
run: |
|
2024-09-04 17:01:08 +08:00
|
|
|
gitbook install docs
|
2024-09-04 16:52:37 +08:00
|
|
|
gitbook build docs
|
2024-09-04 17:04:22 +08:00
|
|
|
mv docs/_book _site
|
2024-09-04 16:52:37 +08:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v3
|
|
|
|
|
|
|
|
# Deployment job
|
|
|
|
deploy:
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v4
|