@@ -47,14 +47,21 @@ jobs:
4747 sudo apt-get update
4848 sudo apt-get install -y --no-install-recommends python3-venv
4949
50- -name :Build doc
50+ -name :Buildand publish doc
5151run :|
5252 ref=${GITHUB_REF#refs/pull/}
53- ref=${ref%/merge}
53+ pr_num=${ref%/merge}
54+ output_dir=build/html/${{ github.base_ref }}/${pr_num}
55+
5456 cd cpython/Doc
5557 make venv
56- make build ALLSPHINXOPTS="-b html -D language=ja -D gettext_compact=0 -E -d build/doctrees . ${{ github.workspace }}/build/html/${{ github.base_ref }}/${ref}"
58+ rm -rf ${output_dir}
59+ make build ALLSPHINXOPTS="-b html -D language=ja -D gettext_compact=0 -E -d build/doctrees . ${{ github.workspace }}/${output_dir}"
60+ ls -l ${output_dir}
5761
58- -name :Publish PR build
59- run :|
60- ls -l build/html/*/*/*
62+ cd build/html
63+ git config --local user.name "Autobuild bot on GitHub Actions"
64+ git config --local user.email "githubaction-build-bot@example.com"
65+ git add ${output_dir}
66+ git commit -m 'update html'
67+ git push "https://${{ github.token }}@github.com/${{ github.repository }}.git" gh-pages:gh-pages