Skip to content

Update Commit Preview action to use reusable build and publish jobs #299

Update Commit Preview action to use reusable build and publish jobs

Update Commit Preview action to use reusable build and publish jobs #299

Workflow file for this run

on: [push]
name: Commit preview
jobs:
build-website:
uses: ./.github/workflows/build-website.yml
publish:
uses: ./.github/workflows/publish.yml
needs: build-website
comment-on-commit:
name: Add a comment on the commit
runs-on: ubuntu-latest
needs: build-website
permissions:
contents: read
steps:
- name: Comment on the Comment
if: env.GITHUB_PUBLISH_TOKEN != ''
uses: peter-evans/commit-comment@5a6f8285b8f2e8376e41fe1b563db48e6cf78c09 # v3.0.0
with:
token: ${{ env.GITHUB_PUBLISH_TOKEN }}
repository: ${{ github.repository }}
sha: ${{ github.sha }}
body: "See preview on Cloudflare Pages: ${{ needs.publish.output.deployment-url }}"