up/.forgejo/workflows/docs.yml
Tolaria 69119f347d
Some checks failed
Deploy Docs / deploy (push) Failing after 24s
feat: add wiki link support ([[page]]) via custom Python-Markdown extension
- New package _extensions/wikilinks.py: preprocessor that converts
  [[Page Name]], [[Page|Text]], [[Page#anchor|Text]], and ![[img]]
  to standard Markdown links before parsing
- Skips wiki links inside fenced/inline code blocks
- Slugifies targets: lowercase, spaces→hyphens
- Registered as markdown extension in zensical.toml
- Updated CI workflow to pip install -e . for the _extensions package
- First usage: [[docs/contributing/index]] in markdown.md
2026-06-03 20:07:25 +08:00

49 lines
No EOL
1.3 KiB
YAML

name: Deploy Docs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
apt-get update && apt-get install -y python3 python3-pip python3-venv
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
python3 --version
pip3 install zensical
pip3 install -e .
- run: |
. /tmp/venv/bin/activate
zensical build --clean
- 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 }}