Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build documentation

on:
pull_request:
branches: [main]
workflow_call:
workflow_dispatch:


jobs:

build:
runs-on: ubuntu-22.04
env:
PUBLISH_DIR: ./_build/html


steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install dependencies
run: python3 -m pip install -r requirements.txt

- name: Build docs
run: jupyter-book build -W --keep-going .

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ${{ env.PUBLISH_DIR }}
73 changes: 0 additions & 73 deletions .github/workflows/build_pages.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish documentation

on:
push:
branches: [main]
workflow_dispatch:


permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:

build:
uses: ./.github/workflows/build_docs.yml

deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Pages
uses: actions/configure-pages@v5


- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
50 changes: 17 additions & 33 deletions {{cookiecutter.repository_name}}/.github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,36 @@
# Simple workflow for deploying static content to GitHub Pages
name: Build docs
name: Build documentation

on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- main
branches: [main]
workflow_call:
workflow_dispatch:


jobs:
build_docs:

build:
runs-on: ubuntu-22.04
env:
PYTHON_VERSION: "3.10"
PUBLISH_DIR: ./_build/html


steps:
# checkout the repository
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v5

# setup Python
- name: Install Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: "3.10"

# preserve pip cache to speed up installation
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/_build
key: cache_v1
restore-keys: |
cache_v1

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install ".[docs]"
- name: Install dependencies
run: python3 -m pip install ".[docs]"

- name: Build docs
run: python3 -m jupyter book build .
run: jupyter-book build -W --keep-going .

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
name: documentation
path: ${{ env.PUBLISH_DIR }}
34 changes: 12 additions & 22 deletions {{cookiecutter.repository_name}}/.github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
name: Github Pages
name: Publish documentation

on:
push:
branches: [main] # Only run on push to main
branches: [main]
workflow_dispatch:


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-docs:

build:
uses: ./.github/workflows/build_docs.yml

deploy:
needs: [build-docs]

needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Download docs artifact
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v3
with:
name: documentation
path: "./public"

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./public"

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5


- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4