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 python3 ./util/export.py out/master/lints.json
13 if [[ -n $TAG_NAME ]]; then
14 echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
15 cp -r out/master "out/$TAG_NAME"
17 ln -s "$TAG_NAME" out/stable
20 if [[ $BETA = "true" ]]; then
21 echo "Update documentation for the beta release"
22 cp -r out/master/* out/beta
25 # Generate version index that is shown as root index page
26 cp util/gh-pages/versions.html out/index.html
28 echo "Making the versions.json file"
29 python3 ./util/versions.py out
32 # Now let's go have some fun with the cloned repo
33 git config user.name "GHA CI"
34 git config user.email "gha@ci.invalid"
36 if [[ -n $TAG_NAME ]]; then
37 # track files, so that the following check works
38 git add --intent-to-add "$TAG_NAME"
39 if git diff --exit-code --quiet -- $TAG_NAME/; then
40 echo "No changes to the output on this push; exiting."
47 # Update versions file
49 git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
50 elif [[ $BETA = "true" ]]; then
51 if git diff --exit-code --quiet -- beta/; then
52 echo "No changes to the output on this push; exiting."
56 git commit -m "Automatic deploy to GitHub Pages (beta): ${SHA}"
58 if git diff --exit-code --quiet; then
59 echo "No changes to the output on this push; exiting."
63 git commit -m "Automatic deploy to GitHub Pages: ${SHA}"
66 git push "$SSH_REPO" "$TARGET_BRANCH"