Skip to content

Commit 321f987

Browse files
authored
Merge pull request #976 from MapServer/backport-966-to-branch-8-2
[Backport branch-8-2] Clean repository when all languages are rebuilt
2 parents f9f666c + 7e6986c commit 321f987

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
mkdir -p ~/.ssh
2929
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
3030
chmod 600 ~/.ssh/id_rsa
31-
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
31+
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
3232
33-
touch ./build/html/.nojekyll
33+
touch ./build/html/.nojekyll
3434
3535
# get the short commit tag
3636
sha=$(git rev-parse --short ${{ github.sha }})

scripts/ci_deploy_website.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,38 @@ builddir=$1
44
destdir=$2
55
sha=$3
66

7+
# check the PDF was created and upload to https://mapserver.org/pdf/MapServer.pdf
78
if [ -f $builddir/latex/en/MapServer.pdf ]; then
89
set -x
910
scp $builddir/latex/en/MapServer.pdf [email protected]:/var/www/mapserver.org/pdf/
1011
set +x
1112
fi
1213

13-
1414
if [ ! -d $destdir/mapserver.github.io ]; then
1515
git clone [email protected]:mapserver/mapserver.github.io.git $destdir/mapserver.github.io
1616
fi
1717

18+
# remove all previous files in the repo if [build_translations]
19+
# is in the commit message
20+
git log -n1 | grep -q "\\[build_translations\\]"
21+
22+
if [[ $? -eq 0 ]]; then
23+
rm -rf "$destdir/mapserver.github.io"/*
24+
fi
25+
26+
# copy in the newly created files
1827
cd $builddir/html
1928
cp -rf * $destdir/mapserver.github.io
2029

2130
cd $destdir/mapserver.github.io
31+
32+
# restore README.md and .nojekyll from the last commit
33+
git checkout HEAD -- README.md
34+
git checkout HEAD -- .nojekyll
35+
2236
git config user.email "[email protected]"
2337
git config user.name "MapServer deploybot"
2438

25-
#rm -rf _sources */_sources
26-
#rm -rf .doctrees */.doctrees */.buildinfo
27-
2839
git add -A
2940
git commit -m "update with results of commit https://github.com/mapserver/MapServer-documentation/commit/$sha"
3041
git push origin master

0 commit comments

Comments
 (0)