mirror of
https://github.com/awatertrevi/xamarin-neo4j.git
synced 2026-09-22 09:05:29 +00:00
Add Cloudflare Pages preview builds for landing PRs
Triggers a preview deployment on pull requests that touch landing/ files. Posts the preview URL as a comment on the PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
.github/workflows/deploy-landing.yml
vendored
19
.github/workflows/deploy-landing.yml
vendored
@@ -5,8 +5,15 @@ on:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "landing/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "landing/**"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -32,9 +39,19 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy to Cloudflare Pages
|
||||
id: deploy
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: pages deploy dist --project-name=pocketgraph-app
|
||||
command: pages deploy dist --project-name=pocketgraph-app --branch=${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'main' }}
|
||||
workingDirectory: landing
|
||||
|
||||
- name: Comment preview URL on PR
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v3
|
||||
with:
|
||||
message: |
|
||||
🔍 **Preview deployment ready!**
|
||||
${{ steps.deploy.outputs.deployment-url }}
|
||||
comment-tag: cloudflare-preview
|
||||
|
||||
Reference in New Issue
Block a user