Skip to content

Commit

Permalink
Merge branch 'atlas-docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
finsberg committed Aug 21, 2024
2 parents f5c9550 + d9cff1d commit f963c0b
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 15 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
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
PUBLISH_DIR: ./docs/_build/html
DEB_PYTHON_INSTALL_LAYOUT: deb_system
PUBLISH_DIR: ./_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: Copy build images
run: cp _build/html/_images/* demos/.
continue-on-error: true

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

- name: Copy html images
continue-on-error: true
run: cp -r docs/_static ${{ env.PUBLISH_DIR }}/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
53 changes: 53 additions & 0 deletions .github/workflows/deploy_docs.yml
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

0 comments on commit f963c0b

Please sign in to comment.