Skip to content

Commit e600bd1

Browse files
talissoncostaclaude
andcommitted
fix(ci): preserve build artifact before switching to gh-pages branch
The artifact was being lost when switching branches because git checkout replaces the working directory. Move artifact to /tmp before checkout. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 22b55dd commit e600bd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/deploy-demo.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ jobs:
110110
git config user.name "github-actions[bot]"
111111
git config user.email "github-actions[bot]@users.noreply.github.com"
112112
113+
# Move artifact to temp location before switching branches
114+
mv dist-demo /tmp/dist-demo
115+
113116
# Check if gh-pages branch exists
114117
if git ls-remote --heads origin gh-pages | grep -q gh-pages; then
115118
git fetch origin gh-pages
@@ -127,7 +130,7 @@ jobs:
127130
PR_DIR="pr-${{ github.event.pull_request.number }}"
128131
rm -rf "$PR_DIR"
129132
mkdir -p "$PR_DIR"
130-
cp -r dist-demo/* "$PR_DIR/"
133+
cp -r /tmp/dist-demo/* "$PR_DIR/"
131134
132135
git add .
133136
git diff --staged --quiet || git commit -m "Deploy PR #${{ github.event.pull_request.number }} preview"

0 commit comments

Comments
 (0)