Skip to content

Commit

Permalink
Merge pull request #966 from geographika/clean-output
Browse files Browse the repository at this point in the history
Clean repository when all languages are rebuilt
  • Loading branch information
geographika authored Oct 31, 2024
2 parents 7a36b20 + 577850b commit 7805153
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
touch ./build/html/.nojekyll
touch ./build/html/.nojekyll
# get the short commit tag
sha=$(git rev-parse --short ${{ github.sha }})
Expand Down
19 changes: 15 additions & 4 deletions scripts/ci_deploy_website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,38 @@ builddir=$1
destdir=$2
sha=$3

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


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

# remove all previous files in the repo if [build_translations]
# is in the commit message
git log -n1 | grep -q "\\[build_translations\\]"

if [[ $? -eq 0 ]]; then
rm -rf "$destdir/mapserver.github.io"/*
fi

# copy in the newly created files
cd $builddir/html
cp -rf * $destdir/mapserver.github.io

cd $destdir/mapserver.github.io

# restore README.md and .nojekyll from the last commit
git checkout HEAD -- README.md
git checkout HEAD -- .nojekyll

git config user.email "[email protected]"
git config user.name "MapServer deploybot"

#rm -rf _sources */_sources
#rm -rf .doctrees */.doctrees */.buildinfo

git add -A
git commit -m "update with results of commit https://github.com/mapserver/MapServer-documentation/commit/$sha"
git push origin master

0 comments on commit 7805153

Please sign in to comment.