Skip to content

chore(deps-dev): bump @eslint/json from 1.0.1 to 1.1.0 in /components #1065

chore(deps-dev): bump @eslint/json from 1.0.1 to 1.1.0 in /components

chore(deps-dev): bump @eslint/json from 1.0.1 to 1.1.0 in /components #1065

name: Clone Demo App & Deploy to Vercel
on:
pull_request:
paths:
- components/**
permissions:
contents: read
packages: read
pull-requests: write
env:
VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars.VERCEL_PROJECT_ID }}
DEMO_APP_REPO: 'schematichq/schematic-next-example'
jobs:
deploy:
runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache
steps:
- uses: runs-on/action@v2.0.3
- name: Checkout Components Repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24.x'
- name: Install Vercel CLI
run: yarn global add vercel
- name: Build Components Package
run: |
echo "πŸ”¨ Building components package..."
cd components
yarn install
yarn build
- name: Link components
run: |
echo "πŸ“¦ Linking components..."
cd components
yarn link
- name: Clone Demo App
uses: actions/checkout@v6
with:
repository: ${{ env.DEMO_APP_REPO }}
token: ${{ secrets.GITHUB_TOKEN }}
path: schematic-next-example
- name: Setup Demo App & Link Components
run: |
echo "🏠 Setting up demo app..."
cd schematic-next-example
echo "πŸ”— Linking components to demo app..."
yarn link "@schematichq/schematic-components"
echo "πŸ“¦ Installing demo app dependencies..."
yarn install --force
echo "βœ… Components package linked successfully!"
- name: Pull Vercel Environment Information
run: |
cd schematic-next-example
vercel link --yes --scope $VERCEL_ORG_ID --token=${{ secrets.VERCEL_TOKEN }}
vercel env pull --yes --scope $VERCEL_ORG_ID --token=${{ secrets.VERCEL_TOKEN }}
vercel pull --yes --scope $VERCEL_ORG_ID --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project for Vercel
run: |
cd schematic-next-example
echo "πŸ—οΈ Building Next.js app for Vercel..."
vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
id: vercel
if: github.event_name == 'pull_request'
run: |
cd schematic-next-example
echo "πŸš€ Deploying Preview to Vercel..."
DEPLOYMENT_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "DEPLOYMENT_URL=$DEPLOYMENT_URL" >> $GITHUB_ENV
echo "Preview URL: $DEPLOYMENT_URL"
- name: Comment PR with Preview URL
if: github.event_name == 'pull_request' && env.DEPLOYMENT_URL
uses: actions/github-script@v8.0.0
with:
script: |
const deploymentUrl = process.env.DEPLOYMENT_URL;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `πŸš€ **Components Preview Deployed!**
πŸ“ **Preview URL:** ${deploymentUrl}
πŸ”„ **Components Version:** Built from commit \`${context.sha.substring(0, 7)}\`
πŸ“¦ **Demo App:** ${process.env.DEMO_APP_REPO}
`
});
- name: Create Deployment Summary
if: always()
run: |
echo "## πŸš€ Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ job.status }}" == "success" ]; then
echo "βœ… **Status:** Deployment completed successfully!" >> $GITHUB_STEP_SUMMARY
echo "πŸ”— **URL:** ${{ env.DEPLOYMENT_URL }}" >> $GITHUB_STEP_SUMMARY
echo "πŸ“¦ **Demo App:** ${{ env.DEMO_APP_REPO }}" >> $GITHUB_STEP_SUMMARY
echo "πŸ”„ **Components:** Built from commit \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Status:** Deployment failed!" >> $GITHUB_STEP_SUMMARY
echo "πŸ“‹ Check the workflow logs for details." >> $GITHUB_STEP_SUMMARY
fi