2026-06-03 09:31:53 +00:00
|
|
|
name: Deploy Docs
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
jobs:
|
|
|
|
|
deploy:
|
2026-06-03 14:55:03 +00:00
|
|
|
runs-on:
|
|
|
|
|
container:
|
|
|
|
|
image: python:3.12
|
2026-06-03 09:31:53 +00:00
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
2026-06-03 14:54:09 +00:00
|
|
|
- run: python3 --version
|
2026-06-03 09:31:53 +00:00
|
|
|
|
2026-06-03 10:17:17 +00:00
|
|
|
- run: |
|
2026-06-03 14:54:09 +00:00
|
|
|
python3 -m venv /tmp/venv
|
2026-06-03 10:17:17 +00:00
|
|
|
. /tmp/venv/bin/activate
|
2026-06-03 14:55:03 +00:00
|
|
|
pip install --upgrade pip
|
|
|
|
|
pip install zensical
|
|
|
|
|
pip install -e .
|
2026-06-03 10:17:17 +00:00
|
|
|
zensical build --clean
|
2026-06-03 09:31:53 +00:00
|
|
|
|
|
|
|
|
- name: Deploy to pages branch
|
|
|
|
|
run: |
|
|
|
|
|
set -e
|
|
|
|
|
git config user.name "forgejo-actions"
|
|
|
|
|
git config user.email "forgejo-actions@noreply.local"
|
|
|
|
|
|
|
|
|
|
git fetch origin pages
|
|
|
|
|
git worktree add /tmp/pages-deploy origin/pages
|
|
|
|
|
cd /tmp/pages-deploy
|
|
|
|
|
|
|
|
|
|
git rm -rf --ignore-unmatch .
|
|
|
|
|
cp -r "$GITHUB_WORKSPACE"/site/* .
|
|
|
|
|
cp "$GITHUB_WORKSPACE"/site/.[!.]* . 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
git add .
|
|
|
|
|
if ! git diff --staged --quiet; then
|
|
|
|
|
git commit -m "deploy: zensical build from ${GITHUB_SHA::7}"
|
|
|
|
|
git push origin HEAD:pages
|
|
|
|
|
else
|
|
|
|
|
echo "No changes to deploy"
|
|
|
|
|
fi
|
|
|
|
|
env:
|
|
|
|
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
|
|
|
|
GITHUB_SHA: ${{ github.sha }}
|