diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 9879320..dcc4e9b 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -300,6 +300,14 @@ jobs: with: artifact_name: ${{ env.PAGES_ARTIFACT_NAME }} + - name: Post deployment URL to summary + if: steps.deploy-pages.outputs.page_url != '' + env: + DOCUMENTATION_URL: "${{ steps.deploy-pages.outputs.page_url }}${{ steps.target.outputs.folder }}/" + run: | + echo "### Documentation published" >> $GITHUB_STEP_SUMMARY + echo "${{ env.DOCUMENTATION_URL }}" >> $GITHUB_STEP_SUMMARY + - name: Find existing PR comment if: steps.metadata.outputs.should_deploy == 'true' && steps.metadata.outputs.pr_number != '' uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 @@ -312,8 +320,10 @@ jobs: - name: Comment on PR with preview link if: steps.metadata.outputs.should_deploy == 'true' && steps.metadata.outputs.pr_number != '' && steps.fc.outputs.comment-id == '' uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 + env: + DOCUMENTATION_URL: "${{ steps.deploy-pages.outputs.page_url || format('https://{0}.github.io/{1}/', github.repository_owner, github.event.repository.name) }}${{ steps.target.outputs.folder }}/" with: issue-number: ${{ steps.metadata.outputs.pr_number }} body: | Documentation preview for this pull request is available at: - **${{ steps.target.outputs.folder }}**: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.target.outputs.folder }}/ + **${{ steps.target.outputs.folder }}**: ${{ env.DOCUMENTATION_URL }}