Skip to content

Documentation

Documentation #12

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build and Deploy Pages
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" or "master" branch
push:
branches:
- main
- master
- Documentation
paths:
- 'twobilliontoolkit/docs/**' # Trigger on changes in the docs folder
- 'twobilliontoolkit/mkdocs.yml' # Trigger on changes to mkdocs.yml
pull_request:
branches:
- main
- master
- Documentation
paths:
- 'twobilliontoolkit/docs/**' # Trigger on changes in the docs folder
- 'twobilliontoolkit/mkdocs.yml' # Trigger on changes to mkdocs.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# These permissions are required for it to work
permissions:
contents: write
pages: write
id-token: write
# Makes sure only one workflow runs at a time.
concurrency:
group: 'pages'
cancel-in-progress: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Required environment setup for GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.pages_url }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout Repository
uses: actions/checkout@v4
# Configure Git user information
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# Setup Python 3.10 for MkDocs
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
# Cache MkDocs dependencies to speed up workflow runs
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
# Install the twobilliontoolkit module
- name: Install the twobilliontoolkit
run: pip install -e .
# Install MkDocs, MkDocs dostrings, and MkDocs Material theme
- name: Install mkdocs
run: pip install mkdocs==1.6.0
- name: Install mkdocstrings with Python handler
run: pip install mkdocstrings[python]==0.25.1
- name: Install mkdocs-material
run: pip install mkdocs-material==9.5.28
# Set the PYTHONPATH environment variable
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)" >> $GITHUB_ENV
# Deploy the MkDocs documentation to GitHub Pages
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force --config-file twobilliontoolkit/mkdocs.yml