forked from facebookresearch/nocturne
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Github Pages workflow for Sphinx docs
- Loading branch information
1 parent
d318bf9
commit 33c47cd
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Workflow for building Sphinx docs and deploying to GH Pages | ||
name: Build Sphinx docs and deploy to GH Pages | ||
|
||
on: | ||
# Runs on pushes | ||
push # TODO: Update to push on main branch only before merging to main | ||
|
||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, cancelling in-progress runs. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "This job is now running on a ${{ runner.os }} server." | ||
- run: echo "Running on branch ${{ github.ref }} of repository ${{ github.repository }}." | ||
- name: Check out repository code. | ||
uses: actions/checkout@v3 | ||
- name: Python environment setup | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies. | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libsfml-dev | ||
git submodule sync | ||
git submodule update --init --recursive | ||
python -m pip install -U pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
if [ -f requirements.dev.txt ]; then pip install -r requirements.dev.txt; fi | ||
pip install -e . | ||
- name: Build HTML docs | ||
run: sphinx-build -b html docs/source/ docs/build/html | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: './docs/build/html' # Upload HTML docs only | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |