Skip to content

Commit 5eb9584

Browse files
authored
Merge pull request #8893 from kenjis/usergide-deploy-script
chore: improve user guide deploy script
2 parents 05b3f4f + 61c4577 commit 5eb9584

File tree

1 file changed

+6
-3
lines changed
  • admin/userguide/.github/scripts

1 file changed

+6
-3
lines changed

admin/userguide/.github/scripts/deploy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Deploys the User Guide to the production
44
# website. Triggered by updates to the GitHub
5-
# repo's master branch.
5+
# codeigniter4/userguide repo's master branch.
6+
# See https://github.com/codeigniter4/userguide/blob/master/.github/workflows/deploy.yml
67

78
REPO=/opt/userguide
89
SITE=/home/public_html/userguides/userguide4
@@ -11,5 +12,7 @@ cd "$REPO"
1112
git switch master
1213
git pull
1314

14-
rm -rf "$SITE"
15-
cp -R "$REPO/docs" "$SITE"
15+
cp -R "$REPO/docs" "$SITE.new"
16+
mv "$SITE" "$SITE.old"
17+
mv "$SITE.new" "$SITE"
18+
rm -rf "$SITE.old"

0 commit comments

Comments
 (0)