mkdocs conf #4
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 | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install mkdocs | |
pip install mkdocs-material | |
- name: Configure Git | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Debug Information | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "Directory contents:" | |
ls -R | |
echo "MkDocs version:" | |
mkdocs --version | |
- name: Build site | |
run: mkdocs build --verbose | |
- name: Deploy | |
run: | | |
mkdocs gh-deploy --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check gh-pages branch | |
run: | | |
git checkout gh-pages | |
echo "gh-pages branch contents:" | |
ls -R |