Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Update to modern GitHub Pages deployment
  • Loading branch information
bparks13 committed May 2, 2025
commit 23706b379aa6cb1f02e06a86eb46d5842b922c27
62 changes: 37 additions & 25 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Update Documentation
name: Build Documentation

on:
push:
branches:
- main
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -19,36 +19,48 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.10.12"

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv==2024.4.1 wheel

- id: cache-pipenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev

- name: Make
- name: Build HTML pages
run: |
pipenv run make html

# 2. Add and commit HTML files to gh-pages branch
- name: Commit documentation changes
pipenv run make html SPHINXOPTS="-W --keep-going"
- name: Check all external links
id: make_linkcheck
run: |
git clone https://github.com/${{ github.repository_owner }}/gui-docs.git --branch gh-pages --single-branch gh-pages
cd gh-pages
rm -rf *
cp -r ../docs/html/* .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true

# 3. Push changes to gh-pages branch (updates documentation page)
- name: Push changes
uses: ad-m/github-push-action@master
pipenv run make linkcheck SPHINXOPTS="-W --keep-going"

- name: Upload GitHub Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
path: docs/html/

deploy:
name: Deploy docs
runs-on: ubuntu-22.04
needs: build
if: github.event_name == 'push' && always() && !failure() && !cancelled()

permissions:
# Both required by actions/deploy-pages
pages: write
id-token: write

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

Loading