0.12.0-17 docs
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
name: Deploy Docs to GitHub Pages
|
name: Deploy Docs to GitHub Pages
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -53,8 +56,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Ensure both refs are available locally.
|
has_ref() {
|
||||||
git fetch origin main dev
|
git rev-parse --verify --quiet "$1" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fetch refs separately (robust when one branch is not yet mirrored to GitHub).
|
||||||
|
git fetch origin main || true
|
||||||
|
git fetch origin dev || true
|
||||||
|
|
||||||
MAIN_REF="origin/main"
|
MAIN_REF="origin/main"
|
||||||
DEV_REF="origin/dev"
|
DEV_REF="origin/dev"
|
||||||
@@ -65,21 +73,41 @@ jobs:
|
|||||||
DEV_REF="${SHA}"
|
DEV_REF="${SHA}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! has_ref "${MAIN_REF}"; then
|
||||||
|
echo "::error::Konnte Main-Ref '${MAIN_REF}' nicht auflösen. Main-Doku kann nicht gebaut werden."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! has_ref "${DEV_REF}"; then
|
||||||
|
echo "::warning::Dev-Ref '${DEV_REF}' nicht gefunden. Es wird ein Platzhalter unter /dev erzeugt."
|
||||||
|
DEV_REF=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Build each branch in its own worktree and merge into one Pages artifact:
|
# Build each branch in its own worktree and merge into one Pages artifact:
|
||||||
# - main docs at site/
|
# - main docs at site/
|
||||||
# - dev docs at site/dev/
|
# - dev docs at site/dev/
|
||||||
rm -rf .worktrees site
|
rm -rf .worktrees site
|
||||||
mkdir -p .worktrees
|
mkdir -p .worktrees
|
||||||
git worktree add --detach .worktrees/main "${MAIN_REF}"
|
git worktree add --detach .worktrees/main "${MAIN_REF}"
|
||||||
git worktree add --detach .worktrees/dev "${DEV_REF}"
|
|
||||||
|
|
||||||
mkdocs build --strict --verbose \
|
mkdocs build --strict --verbose \
|
||||||
--config-file .worktrees/main/mkdocs.yml \
|
--config-file .worktrees/main/mkdocs.yml \
|
||||||
--site-dir site
|
--site-dir site
|
||||||
|
|
||||||
|
if [ -n "${DEV_REF}" ]; then
|
||||||
|
git worktree add --detach .worktrees/dev "${DEV_REF}"
|
||||||
mkdocs build --strict --verbose \
|
mkdocs build --strict --verbose \
|
||||||
--config-file .worktrees/dev/mkdocs.yml \
|
--config-file .worktrees/dev/mkdocs.yml \
|
||||||
--site-dir site/dev
|
--site-dir site/dev
|
||||||
|
else
|
||||||
|
mkdir -p site/dev
|
||||||
|
cat > site/dev/index.html <<'EOF'
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="de">
|
||||||
|
<head><meta charset="utf-8"><title>Dev Doku</title></head>
|
||||||
|
<body><p>Dev-Dokumentation ist aktuell auf GitHub noch nicht verfügbar.</p></body>
|
||||||
|
</html>
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload Pages artifact
|
- name: Upload Pages artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
|||||||
Reference in New Issue
Block a user