-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
name: Github Pages | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Build docs | ||
|
||
on: [push] | ||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
# This workflow can be executed inside another workfow file | ||
workflow_call: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16 | ||
container: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16 | ||
env: | ||
# Directory that will be published on github pages | ||
DEB_PYTHON_INSTALL_LAYOUT: deb_system | ||
PUBLISH_DIR: ./docs/_build/html | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
|
||
- name: Install dependencies | ||
run: python3 -m pip install -e ".[docs]" | ||
run: python3 -m pip install ".[docs]" | ||
|
||
- name: Cache notebooks | ||
id: cache-notebooks | ||
uses: actions/cache@v4 | ||
with: | ||
path: _build | ||
key: cache_key_1 # Bump number manually when you want to clear the cache | ||
|
||
- name: Build docs | ||
run: jupyter book build -W docs | ||
run: jupyter book build -W --keep-going docs | ||
|
||
- name: Deploy | ||
if: github.ref == 'refs/heads/main' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: Upload documentation as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{ env.PUBLISH_DIR }} | ||
name: documentation | ||
path: ${{ env.PUBLISH_DIR }} | ||
if-no-files-found: error |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy to github pages | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
|
||
# Build documentation/website. Will be downloaded in first step | ||
build-docs: | ||
uses: ./.github/workflows/build_docs.yml | ||
|
||
deploy: | ||
needs: [build-docs] | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
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@v4 | ||
with: | ||
name: documentation | ||
path: "./public" | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "./public" | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |