mirror of
https://github.com/awatertrevi/xamarin-neo4j.git
synced 2026-09-22 09:05:29 +00:00
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>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Deploy Landing to Cloudflare Pages
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- "landing/**"
|
|
pull_request:
|
|
paths:
|
|
- "landing/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: landing/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: landing
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
working-directory: landing
|
|
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 --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
|