Skip to content

github action for mkdocs 1 #2

github action for mkdocs 1

github action for mkdocs 1 #2

Workflow file for this run

name: Deploy Documentation to GitHub Pages
on:
# Trigger the workflow on push events to the main branch
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read # Read access to checkout the code
pages: write # Write access to deploy to Pages
id-token: write # Needed for OIDC token if using advanced deployment methods
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# If you have git-submodules
# with:
# submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x # Use a recent Python 3 version
cache: 'pip' # Cache pip dependencies
- name: Install dependencies
run: pip install -r requirements.txt # Install from requirements.txt
# --- !!! ---
# Add steps here to generate automatic content if needed
# Example:
# - name: Generate Javadoc
# run: |
# echo "Running Javadoc generation..."
# # Actual command to generate Javadoc into e.g., docs/reference/javadoc
# mkdir -p docs/reference/javadoc
# echo "<html><body>Generated Javadoc Placeholder</body></html>" > docs/reference/javadoc/index.html
# --- !!! ---
- name: Build MkDocs site
working-directory: ./site-docs
run: mkdocs build --verbose # Build into the 'site' directory
- name: Upload artifact
uses: actions/upload-pages-artifact@v3 # Use updated action
with:
# Upload entire site directory built by mkdocs
path: './site-docs/site'
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }} # Output the deployed URL
runs-on: ubuntu-latest
needs: build # Run after the build job is successful
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # Use updated action for deployment