Skip to content

Commit a01232a

Browse files
committed
make ci_deploy_gh_pages.sh executable
1 parent 15421ca commit a01232a

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

scripts/ci_deploy_gh_pages.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# Deploys the main branch HTML build output to the gh-pages branch of the
3+
# MapServer-documentation repo. Called from build.yml when a push to main
4+
# is detected
5+
6+
builddir=$1
7+
sha=$2
8+
github_token=$3
9+
10+
git config user.email "mapserverbot@mapserver.bot"
11+
git config user.name "MapServer deploybot"
12+
13+
git clone --no-checkout --depth=1 \
14+
https://x-access-token:${github_token}@github.com/mapserver/MapServer-documentation.git \
15+
/tmp/MapServer-documentation
16+
17+
cd /tmp/MapServer-documentation
18+
git checkout -B gh-pages
19+
20+
# delete existing files
21+
git rm -r * --quiet || true
22+
23+
# add in the new build files
24+
cp -rf "$builddir/html/"* .
25+
touch .nojekyll
26+
27+
git add -A
28+
git commit -m "update with results of commit https://github.com/mapserver/MapServer-documentation/commit/$sha" --quiet || echo "Nothing to commit"
29+
git push origin gh-pages --force

0 commit comments

Comments
 (0)