Skip to content

Improve workflow handling (#118) #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2023
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
17 changes: 17 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Install dependencies


runs:
using: composite
steps:
- name: Install apt dependencies and upgrade pip
shell: bash -el {0}
run: |
apt-get update && apt-get install -y libgl1-mesa-glx libxrender1 xvfb
python3 -m pip install -U pip
# Install `h5py` master branch
# https://github.com/hl5py/h5py/issues/2222
- name: Install h5py and pip requirements
shell: bash -el {0}
run: |
python3 -m pip install --no-binary=h5py git+https://github.com/h5py/h5py@master
46 changes: 46 additions & 0 deletions .github/workflows/book_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test stable build of book

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

env:
HDF5_MPI: "ON"
HDF5_DIR: "/usr/local/"
DISPLAY: ":99.0"
DEB_PYTHON_INSTALL_LAYOUT: deb_system

jobs:
build-book:
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/lab:v0.6.0-r1

env:
PYVISTA_TRAME_SERVER_PROXY_PREFIX: '/proxy/'
PYVISTA_TRAME_SERVER_PROXY_ENABLED: "True"
PYVISTA_OFF_SCREEN: false
PYVISTA_JUPYTER_BACKEND: "panel"

steps:

- uses: actions/checkout@v3

- name: Install common packages
uses: ./.github/actions/install-dependencies

- name: Install book deps
run:
python3 -m pip install -r docker/requirements.txt

- name: Build the book
run:
jupyter-book build . -W

- uses: actions/upload-artifact@v3
with:
name: webpage
path: ./_build/html
retention-days: 2
if-no-files-found: error
176 changes: 0 additions & 176 deletions .github/workflows/build-publish.yml

This file was deleted.

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

on:
push:
branches:
- "main"
workflow_dispatch:

# Weekly build on Mondays at 8 am
schedule:
- cron: "0 8 * * 1"

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

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

env:
HDF5_MPI: "ON"
HDF5_DIR: "/usr/local/"
DISPLAY: ":99.0"
DEB_PYTHON_INSTALL_LAYOUT: deb_system

jobs:
run-tests:
uses: ./.github/workflows/test_stable.yml

build-book:
uses: ./.github/workflows/build_stable.yaml

deploy:
needs: [build-book, run-tests]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

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

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

- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: webpage
path: "./public"

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

- name: Deploy coverage report to GH Pages
id: deployment
uses: actions/deploy-pages@v1
Loading