mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 13:12:10 +00:00
Backport of #11289 to `core/1.43` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11483-backport-core-1-43-fix-deploy-website-previews-via-GitHub-Actions-instead-of-Vercel-a-3486d73d36508164a683c20663d017f3) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: DrJKL <DrJKL0424@gmail.com> Co-authored-by: Amp <amp@ampcode.com>
91 lines
2.7 KiB
YAML
91 lines
2.7 KiB
YAML
---
|
|
name: 'CI: Vercel Website Preview'
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
paths:
|
|
- 'apps/website/**'
|
|
- 'packages/design-system/**'
|
|
- 'packages/tailwind-utils/**'
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'apps/website/**'
|
|
- 'packages/design-system/**'
|
|
- 'packages/tailwind-utils/**'
|
|
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_WEBSITE_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_WEBSITE_PROJECT_ID }}
|
|
|
|
jobs:
|
|
deploy-preview:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
|
|
|
|
- name: Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
|
|
- name: Pull Vercel environment information
|
|
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_WEBSITE_TOKEN }}
|
|
|
|
- name: Build project artifacts
|
|
run: vercel build --token=${{ secrets.VERCEL_WEBSITE_TOKEN }}
|
|
|
|
- name: Deploy project artifacts to Vercel
|
|
id: deploy
|
|
run: |
|
|
URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_WEBSITE_TOKEN }})
|
|
echo "url=$URL" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Add deployment URL to summary
|
|
run: echo "**Preview:** ${{ steps.deploy.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Save PR metadata
|
|
run: |
|
|
mkdir -p temp/vercel-preview
|
|
echo "${{ steps.deploy.outputs.url }}" > temp/vercel-preview/url.txt
|
|
|
|
- name: Upload preview metadata
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: vercel-preview
|
|
path: temp/vercel-preview
|
|
|
|
deploy-production:
|
|
if: github.event_name == 'push'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
|
|
|
|
- name: Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
|
|
- name: Pull Vercel environment information
|
|
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_WEBSITE_TOKEN }}
|
|
|
|
- name: Build project artifacts
|
|
run: vercel build --prod --token=${{ secrets.VERCEL_WEBSITE_TOKEN }}
|
|
|
|
- name: Deploy project artifacts to Vercel
|
|
id: deploy
|
|
run: |
|
|
URL=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_WEBSITE_TOKEN }})
|
|
echo "url=$URL" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Add deployment URL to summary
|
|
run: echo "**Production:** ${{ steps.deploy.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"
|