deploy-docs #4
Workflow file for this run
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-docs | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory | |
paths: | |
- "book/**" | |
- ".github/workflows/deploy-docs.yaml" | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
# install the source code | |
- name: Install the source code | |
run: pip install . | |
# Build the book | |
- name: Build the book | |
run: | | |
pip install -r book/requirements.txt | |
bash book/_scripts/build.sh --all | |
# Deploy the book's HTML to gh-pages branch | |
- name: GitHub Pages action | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: book/_build/html | |
cname: |