Resolves Issues #39 & #40 (#41) #12
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
# Workflow for building and deploying static content to GitHub Pages | |
name: Build and Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9.18' | |
- name: Cache pip packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/setup.cfg') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Set up virtual environment | |
if: steps.cache-python.outputs.cache-hit != 'True' | |
run: python -m venv .venv | |
- name: Activate virtual environment | |
run: | | |
ls .venv | |
source .venv/bin/activate | |
- name: Install all project dependencies | |
if: steps.cache-python.outputs.cache-hit != 'True' | |
run: | | |
pip install --upgrade pip | |
pip install -e .[test,doc] | |
- name: Generate HTML documentation with pdoc | |
env: | |
GIT_REPO_OWNER: ${{ github.repository_owner }} | |
GIT_REPO_NAME: ${{ github.event.repository.name }} | |
run: ./scripts/build-documentation.sh | |
- name: Upload artifact to Pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: .cmmvae/docs | |
name: gh-pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: gh-pages |