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
name: Deploy MkDocs to GitHub Pages | |
on: | |
push: | |
branches: | |
- SoftwareX # Adjust if your branch is different | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# Build the MkDocs site | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install MkDocs and Plugins | |
run: | | |
pip install mkdocs-material mkdocstrings # Add any additional plugins you use | |
pip install mkdocstrings_handlers | |
- name: Build MkDocs Site | |
run: mkdocs build | |
- name: Upload Built Site as Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site # MkDocs outputs the site to the 'site/' directory by default | |
# Deploy the site to GitHub Pages | |
deploy: | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |