feat(ci): change the workflow to automatically push the docs page #2
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: | |
- 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 |