Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean repository when all languages are rebuilt #966

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading