Added logging #199
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' # Using Node.js version 12.18.2 | |
timeout-minutes: 5 | |
- name: Install npm | |
run: npm install -g npm@6.14.5 # Using npm version 6.14.5 | |
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 # Ignore errors from `gitbook install` | |
timeout-minutes: 5 | |
- name: Build GitBook | |
run: gitbook build . ./_book | |
timeout-minutes: 5 | |
- name: Archive the GitBook output | |
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} | |
run: | | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "./_book" \ | |
-cvf "/home/runner/work/_temp/artifact.tar" \ | |
. | |
env: | |
INPUT_PATH: ./_book/ | |
timeout-minutes: 5 | |
- name: Add .gitbook to existing tar | |
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} | |
run: | | |
tar \ | |
--dereference --hard-dereference \ | |
-rf "/home/runner/work/_temp/artifact.tar" \ | |
./.gitbook/ | |
env: | |
INPUT_PATH: ./_book/ | |
timeout-minutes: 5 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages | |
path: ${{ runner.temp }}/artifact.tar | |
retention-days: 1 | |
if-no-files-found: error # Fail if no files are found to catch issues early | |
overwrite: true | |
env: | |
GITHUB_PAGES: true | |
timeout-minutes: 5 | |
- name: List Temp Directory | |
run: ls -R ${{ runner.temp }} | |
deploy: | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: github-pages | |
path: ${{ runner.temp }} | |
timeout-minutes: 5 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 | |
timeout-minutes: 5 |