diff --git a/.github/workflows/documentation-website.yaml b/.github/workflows/documentation-website.yaml index a888f088..14d58d0c 100644 --- a/.github/workflows/documentation-website.yaml +++ b/.github/workflows/documentation-website.yaml @@ -9,6 +9,10 @@ on: branches: - main +permissions: + contents: read + pull-requests: write + jobs: build_and_deploy_job: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') @@ -28,10 +32,21 @@ jobs: uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_THANKFUL_WATER_0A297BF00 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} action: "upload" skip_app_build: true app_location: "docs/.vitepress/dist" + - name: Comment PR preview URL + if: github.event_name == 'pull_request' + uses: marocchino/sticky-pull-request-comment@v3 + with: + header: documentation-website-preview + message: | + ### Documentation preview + + The documentation preview has been deployed for this pull request. + + - Preview: ${{ steps.builddeploy.outputs.static_web_app_url }} + - Commit: ${{ github.sha }} close_pull_request_job: if: github.event_name == 'pull_request' && github.event.action == 'closed'