Improved the test cases. #3
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: doc-ci | |
on: | |
push: | |
branches: | |
- master | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository | |
- uses: actions/checkout@v4 | |
# Configure Git credentials | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
# Set up Python environment | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.10 | |
# Caching dependencies | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
# Install MkDocs, Mike, and theme | |
- run: pip install mkdocs-material mike | |
# Build and deploy using mike | |
- run: | | |
mike deploy --push --update-aliases 1.0 latest # Replace '1.0' with your desired version | |
# Optionally, publish to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site # This is where mkdocs outputs the built site |