update docs and first draft #2
This file contains hidden or 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 to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install \ | |
mkdocs-material \ | |
mkdocs-awesome-pages-plugin \ | |
mkdocs-minify-plugin \ | |
mkdocstrings[python] \ | |
mkdocs-material-extensions \ | |
pygments | |
- name: Build documentation | |
run: | | |
# Clean any previous build | |
rm -rf site public | |
# Build documentation with verbose output | |
mkdocs build --verbose --strict || { echo "❌ mkdocs build failed"; exit 1; } | |
# Create public directory and move site contents | |
mkdir -p public | |
cp -r site/. public/ | |
# Add CNAME for GitHub Pages | |
echo 'wronai.github.io' > public/CNAME | |
# Verify the build output | |
if [ ! -d "public" ] || [ -z "$(ls -A public)" ]; then | |
echo "❌ Build failed: public directory is empty or missing" | |
ls -la | |
exit 1 | |
fi | |
echo "✅ Build completed successfully" | |
echo "Build contents:" | |
ls -la public/ | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./public | |
retention-days: 1 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |