5 echo "Removing the current docs for master"
6 rm -rf out/master/ || exit 0
8 echo "Making the docs for master"
10 cp util/gh-pages/index.html out/master
11 cp util/gh-pages/script.js out/master
12 cp util/gh-pages/lints.json out/master
14 if [[ -n $TAG_NAME ]]; then
15 echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
16 cp -Tr out/master "out/$TAG_NAME"
18 ln -s "$TAG_NAME" out/stable
21 if [[ $BETA = "true" ]]; then
22 echo "Update documentation for the beta release"
23 cp -r out/master/* out/beta
26 # Generate version index that is shown as root index page
27 cp util/gh-pages/versions.html out/index.html
29 echo "Making the versions.json file"
30 python3 ./util/versions.py out
32 # Now let's go have some fun with the cloned repo
34 git config user.name "GHA CI"
35 git config user.email "gha@ci.invalid"
37 if [[ -n $TAG_NAME ]]; then
38 # track files, so that the following check works
39 git add --intent-to-add "$TAG_NAME"
40 if git diff --exit-code --quiet -- $TAG_NAME/; then
41 echo "No changes to the output on this push; exiting."
48 # Update versions file
50 git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
51 elif [[ $BETA = "true" ]]; then
52 if git diff --exit-code --quiet -- beta/; then
53 echo "No changes to the output on this push; exiting."
57 git commit -m "Automatic deploy to GitHub Pages (beta): ${SHA}"
59 if git diff --exit-code --quiet; then
60 echo "No changes to the output on this push; exiting."
64 git commit -m "Automatic deploy to GitHub Pages: ${SHA}"
67 git push "$SSH_REPO" "$TARGET_BRANCH"