- Initialize Next.js 15.5.4 with TypeScript and App Router - Configure Tailwind CSS v4 with ShadCN UI component library - Set up OpenNext for Cloudflare Workers deployment - Add Gitea Actions workflows for CI/CD (lint, build, deploy) - Create issue templates (bug, feature, question) and PR template - Add comprehensive CONTRIBUTING.md and README.md documentation - Configure build scripts and deployment configuration
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: Deploy Preview
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
|
|
jobs:
|
|
deploy-preview:
|
|
name: Deploy Preview to Cloudflare
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build with OpenNext
|
|
run: npm run build:open-next
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Deploy to Cloudflare Workers (Preview)
|
|
run: |
|
|
npx wrangler deploy --env preview
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
- name: Comment PR with preview URL
|
|
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: '🚀 Preview deployment ready! View your changes at the preview URL.'
|
|
})
|
|
|