Skip to content

Commit d9bf9f0

Browse files
committed
Auto merge of #5806 - flip1995:deploy_beta_fix, r=phansch
Fix deploy script for beta deployment Since the `beta/` directory already exists, we can't copy the complete `master` dir changelog: none
2 parents bb67423 + c65eb4d commit d9bf9f0

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/deploy.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919

2020
if [[ $BETA = "true" ]]; then
2121
echo "Update documentation for the beta release"
22-
cp -r out/master out/beta
22+
cp -r out/master/* out/beta
2323
fi
2424

2525
# Generate version index that is shown as root index page
@@ -33,12 +33,13 @@ cd out
3333
git config user.name "GHA CI"
3434
git config user.email "[email protected]"
3535

36-
if git diff --exit-code --quiet; then
37-
echo "No changes to the output on this push; exiting."
38-
exit 0
39-
fi
40-
4136
if [[ -n $TAG_NAME ]]; then
37+
# track files, so that the following check works
38+
git add --intent-to-add "$TAG_NAME"
39+
if git diff --exit-code --quiet -- $TAG_NAME/; then
40+
echo "No changes to the output on this push; exiting."
41+
exit 0
42+
fi
4243
# Add the new dir
4344
git add "$TAG_NAME"
4445
# Update the symlink
@@ -47,9 +48,17 @@ if [[ -n $TAG_NAME ]]; then
4748
git add versions.json
4849
git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
4950
elif [[ $BETA = "true" ]]; then
51+
if git diff --exit-code --quiet -- beta/; then
52+
echo "No changes to the output on this push; exiting."
53+
exit 0
54+
fi
5055
git add beta
5156
git commit -m "Automatic deploy to GitHub Pages (beta): ${SHA}"
5257
else
58+
if git diff --exit-code --quiet; then
59+
echo "No changes to the output on this push; exiting."
60+
exit 0
61+
fi
5362
git add .
5463
git commit -m "Automatic deploy to GitHub Pages: ${SHA}"
5564
fi

0 commit comments

Comments
 (0)