Policy Intro added #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
on: | |
pull_request: | |
jobs: | |
build_and_publish_preview: | |
name: Build and Publish Preview | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: ./.github/actions/setup-toolchain | |
- name: Build | |
run: mdbook build | |
- name: Publish to Cloudflare Pages | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
if: env.CLOUDFLARE_API_TOKEN != '' | |
id: publish | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: 03654dab23842c712e474f409d58f55c | |
command: pages deploy ./out/html --project-name=makerspace-wiki | |
- name: Add preview URL comment | |
if: steps.publish.conclusion == 'success' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '✨ you may preview these changes at <${{ steps.publish.outputs.deployment-url }}>' | |
}) |