Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ jobs:
# Restore the new doc dropping changes by "wipe out"
(cd doc && git checkout --quiet -f HEAD~1)
.github/workflows/create-changes-html.sh diff.txt doc
du -b diff.txt | cut -f1 > doc/DIFF_FILE_SIZE.txt
# note that the file above is generated after generating the diff, be careful to not contaminate the git diff
# Sometimes rm -rf .git errors out because of some diehard hidden files
# So we simply move it out of the doc directory
(cd doc && mv .git ../git && mv .gitattributes ../gitattributes)
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ permissions:
jobs:
publish-doc:
runs-on: ubuntu-latest
needs: doc-html
if: github.event.workflow_run.conclusion == 'success'
env:
CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' && secrets.NETLIFY_SITE_ID != '' }}
Expand All @@ -52,6 +53,17 @@ jobs:
- name: Extract doc
run: unzip doc.zip -d doc
if: steps.download-doc.outcome == 'success'
# WARNING: the folder structure is doc/doc/<files>, so for example the CHANGES.html
# generated by doc-build.yml is at doc/doc/CHANGES.html

- name: Read diff file size
id: read-diff-file-size
continue-on-error: true
run: |
cat doc/doc/DIFF_FILE_SIZE.txt # debug print
{ printf 'result='; cat doc/doc/DIFF_FILE_SIZE.txt; } >> "$GITHUB_OUTPUT"
# note that the result will have type string! although "== 0" coerce to number, see
# https://docs.github.com/en/actions/reference/workflows-and-actions/expressions

- name: Deploy to Netlify
id: deploy-netlify
Expand All @@ -75,7 +87,7 @@ jobs:
header: preview-comment
recreate: false
message: |
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/html/en) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}; [changes](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/CHANGES.html)) is ready! :tada:
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/html/en) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}; ${{ steps.read-diff-file-size.outputs.result != 0 && format('[changes]({0}/CHANGES.html) is ready!', steps.deploy-netlify.outputs.NETLIFY_URL) || 'there is no change! ' }} :tada:
This preview will update shortly after each push to this PR.
if: steps.download-doc.outcome == 'success'

Expand Down
Loading