Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
build: publish drafts to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
xenophonf committed Oct 8, 2024
1 parent e1e7d8c commit 1a8fb00
Showing 1 changed file with 125 additions and 0 deletions.
125 changes: 125 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
name: Continuous Integration


# Trigger this workflow manually, by pushing commits to any branch, or
# by filing a pull request.
on:
workflow_dispatch:
push:
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
setup:
runs-on: ubuntu-latest
steps:
# Check out the repository as of this commit and cache the
# working directory for use in other jobs or for re-use if
# re-running the workflow (e.g., something outside of GitHub
# Actions broke).
- id: cache-workdir
uses: actions/cache@v3
with:
key: workdir-${{ github.sha }}
path: .

# Python Semantic Release needs the history of all branches/tags
# to calculate the next version number and build the change log.
- if: steps.cache-workdir.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0


lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/cache/restore@v3
with:
key: workdir-${{ github.sha }}
path: .

# Install linter dependencies here; for example:
# - uses: opentofu/[email protected]
# - uses: terraform-linters/setup-tflint@v4

# Double-check code syntax/style. This ought to happen in a
# pre-commit hook, but not everyone may have that installed.
- uses: pre-commit/[email protected]


docs:
needs:
- setup
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/cache/restore@v3
with:
key: workdir-${{ github.sha }}
path: .

# Install doc builder dependencies.
- run: python -m pip install -U pip-with-requires-python
- run: python -m pip install -U pip setuptools
- run:
python -m pip install -U
argcomplete
ipython
linkify-it-py
matplotlib
myst-parser
sphinx-autodoc2
sphinx-book-theme
sphinx-copybutton
sphinx-design
sphinxext-opengraph
sphinxext-rediraffe
sphinx-intl
sphinx-pyscript
sphinx-tippy
sphinx-togglebutton
- run: python -m pip install .

# Generate hypertext and print media, once per target language.
- run: sphinx-build -b html docs build/html/en -D language=en

# The document generation process could run malicious
# third-party code in a supply chain attack, so this job doesn't
# run with elevated privileges. Instead, it uploads
# documentation into an immutable archive (a GitHub Actions
# Artifact) that a subsequent, privileged job will publish.
- uses: actions/upload-artifact@v4
with:
name: doc-artifacts
path: build/*
if-no-files-found: error
overwrite: true


gh-pages:
needs:
- docs
runs-on: ubuntu-latest
permissions:
# Allow this job to push web content to the gh-pages branch.
contents: write
steps:
# Publish the web content using GitHub Pages.
- uses: actions/download-artifact@v4
with:
name: doc-artifacts
path: build/
merge-multiple: true
- uses: peaceiris/actions-gh-pages@v4
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/html/en

0 comments on commit 1a8fb00

Please sign in to comment.