diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 53710e19..73f6ba03 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -106,6 +106,13 @@ jobs: run: | set -x + echo "User-agent: *" >/tmp/robot.txt + echo "Disallow:" >>/tmp/robot.txt + echo "Sitemap: https://docs.haproxy.org/sitemap.xml" >>/tmp/robot.txt + + echo "" >/tmp/sitemap.xml + echo "" >>/tmp/sitemap.xml + for branch in $BRANCHES; do printf "::group::Building %s\n" "$branch" if [ "$branch" = "dev" ]; then @@ -127,6 +134,13 @@ jobs: rm -rf "docs/$branch/" mkdir "docs/$branch/" + for n in "${files[@]}" + do + file=$(basename $n) + file=${file%*.txt}.html + echo "https://docs.haproxy.org/${$branch}/${file}" >>/tmp/sitemap.xml + done + env SOURCE_DATE_EPOCH="$LASTCHANGE" python3 dconv/dconv.py -g "$PWD/haproxy/" -o "$PWD/docs/$branch/" --base=.. ${files[@]} git add "docs/$branch/" @@ -136,6 +150,20 @@ jobs: printf "::endgroup::\n" done + echo "" >>/tmp/sitemap.xml + + cp /tmp/sitemap.xml docs/sitemap.xml + git add "docs/sitemap.xml" + if ! git diff --cached --quiet; then + git commit -m "Update sitemap.xml" + fi + + cp /tmp/robot.txt docs/robot.txt + git add "docs/robot.txt" + if ! git diff --cached --quiet; then + git commit -m "Update robot.txt" + fi + - name: Push the changes. run: | git push