Files
notes/.gitea/workflows/deploy.yaml
Jay 3b64218fe5
All checks were successful
Build and Deploy MkDocs / deploy (push) Successful in 6s
add workflow
2026-03-03 16:04:48 +00:00

45 lines
1.2 KiB
YAML

name: Build and Deploy MkDocs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for switching branches
- name: Build and Extract Site
run: |
docker build -t mkdocs-temp -f ci/mkdocs/Dockerfile .
docker create --name temp-container mkdocs-temp
# Copying content to a folder named 'output_content' to avoid naming collisions
docker cp temp-container:/build/site ./output_content
docker rm temp-container
- name: Deploy to docs-static Branch
run: |
git config user.name "gitea-actions[bot]"
git config user.email "actions@noreply.gitea.io"
# Increase buffer to handle larger media files
git config http.postBuffer 524288000
mv output_content /tmp/site_final
git checkout --orphan docs-static
git rm -rf .
cp -r /tmp/site_final/. .
# Optional: Remove source maps to save space
find . -name "*.map" -type f -delete
git add .
git commit -m "Automated MkDocs build"
git push origin docs-static --force