[ci] Deploy docs only on tagged builds

Fixes https://github.com/harfbuzz/harfbuzz/issues/2786
This commit is contained in:
Khaled Hosny 2022-07-18 21:02:41 +02:00 committed by Behdad Esfahbod
parent 3723b8544b
commit 378663409a
1 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,10 @@
set -x
set -o errexit -o nounset
TAG="$(git describe --exact-match --match "[0-9]*" HEAD 2>/dev/null || true)"
if [ "$GITHUB_REF_TYPE" != "tag" ]; then
echo "Skipping docs deployment on a non-tagged build";
exit 0;
fi
DOCSDIR=build-docs
REVISION=$(git rev-parse --short HEAD)
@ -17,8 +20,8 @@ cp ../build/docs/html/* .
git init
git branch -m main
git config user.name "Travis CI"
git config user.email "travis@harfbuzz.org"
git config user.name "CI"
git config user.email "harfbuzz-admin@googlegroups.com"
set +x
echo "git remote add upstream \"https://\$GH_TOKEN@github.com/harfbuzz/harfbuzz.github.io.git\""
git remote add upstream "https://$GH_TOKEN@github.com/harfbuzz/harfbuzz.github.io.git"