1 parent 6618148 commit c28eefeCopy full SHA for c28eefe
1 file changed
.github/workflows/deploy-docs-pages.yml
@@ -44,6 +44,11 @@ jobs:
44
set -euo pipefail
45
46
PUBLISH_DIR="${RUNNER_TEMP}/gh-pages"
47
+
48
+ # Clean up stale worktree path from prior attempts.
49
+ git worktree remove --force "$PUBLISH_DIR" 2>/dev/null || true
50
+ rm -rf "$PUBLISH_DIR"
51
52
git fetch origin gh-pages || true
53
54
if git show-ref --verify --quiet refs/remotes/origin/gh-pages; then
@@ -52,7 +57,8 @@ jobs:
57
git worktree add -B gh-pages "$PUBLISH_DIR"
58
fi
59
55
- rsync -av --delete .site/ "$PUBLISH_DIR"/
60
+ # Keep worktree git metadata intact.
61
+ rsync -av --delete --exclude='.git' .site/ "$PUBLISH_DIR"/
56
62
touch "$PUBLISH_DIR/.nojekyll"
63
64
cd "$PUBLISH_DIR"
0 commit comments