Skip to content
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

A build-deploy docs step #15

Merged
merged 1 commit into from
Sep 13, 2024
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
34 changes: 28 additions & 6 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: "Pull Request Docs Check"
name: "Build/Deploy Docs"

on:
- workflow_dispatch
- pull_request
workflow_dispatch:
push:
branches:
- main

jobs:
docs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,8 +20,28 @@ jobs:
- name: Build HTML documentation with Sphinx
run: make html
working-directory: docs
- uses: actions/upload-artifact@v4
- uses: actions/upload-pages-artifact@v3
with:
name: documentation
path: docs/build/html
retention-days: 7

deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions .github/workflows/check_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Pull Request Docs Check"

on:
- workflow_dispatch
- pull_request

jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies and local packages
run: python -m pip install sphinx pydata-sphinx-theme
- name: Build HTML documentation with Sphinx
run: make html
working-directory: docs
- uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/build/html
retention-days: 7