GITBOOK-7: No subject #236
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: Deploy GitBook to GitHub Pages | |
on: | |
push: | |
branches: ["master"] | |
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 | |
timeout-minutes: 5 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '12.18.2' | |
timeout-minutes: 5 | |
- name: Install npm | |
run: npm install -g [email protected] | |
timeout-minutes: 5 | |
- name: Install GitBook CLI | |
run: npm install -g gitbook-cli | |
timeout-minutes: 5 | |
- name: Fetch GitBook version 3.2.3 | |
run: gitbook fetch 3.2.3 | |
timeout-minutes: 5 | |
- name: Install GitBook plugins | |
run: gitbook install || true | |
timeout-minutes: 5 | |
- name: Build GitBook | |
run: gitbook build . ./_book | |
timeout-minutes: 5 | |
- name: Configure GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v3 | |
timeout-minutes: 5 | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: './_book' | |
timeout-minutes: 5 | |
deploy: | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
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@v3 |