Skip to content

Commit

Permalink
Merge pull request #163 from claudioperez/deploy
Browse files Browse the repository at this point in the history
add workflow to deploy docs and remove built HTML from source control
  • Loading branch information
fmckenna authored Oct 25, 2024
2 parents 2bcf216 + 54c85f3 commit f428043
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Sphinx build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "."

# - name: Add NoJekyll
# run: touch build/html/.nojekyll

# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: html-docs
# path: build/html/

- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
path: build/html/


# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/main'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: _build/html
#
# Deployment job
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
if: github.ref == 'refs/heads/master'
uses: actions/deploy-pages@v4

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sphinx>=6.0
sphinx_rtd_theme>=3.0.0

4 changes: 3 additions & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#
import os
import sys
import sphinx_rtd_theme
sys.path.append(os.path.abspath('./sphinx_ext/'))


Expand Down Expand Up @@ -64,7 +65,8 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'toctree_filter'
'toctree_filter',
'sphinx_rtd_theme'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down

0 comments on commit f428043

Please sign in to comment.