Skip to content

feat(ci): change the workflow to automatically push the docs page #2

feat(ci): change the workflow to automatically push the docs page

feat(ci): change the workflow to automatically push the docs page #2

Workflow file for this run

name: Deploy MkDocs to GitHub Pages
on:
push:
branches:
- main # Trigger the workflow on pushes to the 'main' branch
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 1b: Configure Git
- name: Configure Git Credentials
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Step 2: Set up Python environment
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
# Step 3: Install dependencies
- name: Install MkDocs and plugins
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material
# Step 4: Deploy to GitHub Pages with mkdocs
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force