70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Deploy to Cloudflare Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '**.md'
|
|
- '.github/**'
|
|
- '!.github/workflows/cloudflare-deploy.yml'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '**.md'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Build and Deploy to Cloudflare Pages
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Generate runtime configuration
|
|
run: pnpm run gen:runtime
|
|
|
|
- name: Generate manifest
|
|
run: pnpm run gen:manifest
|
|
|
|
- name: Build for Cloudflare Pages
|
|
run: pnpm run pages:build
|
|
|
|
- name: Deploy to Cloudflare Pages
|
|
if: github.event_name != 'pull_request'
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy .vercel/output/static --project-name=katelyatv
|
|
|
|
- name: Build Summary
|
|
run: |
|
|
echo "✅ Build completed successfully!"
|
|
echo "📦 Optimized for Cloudflare Pages"
|
|
echo "🔄 Static generation enabled"
|
|
if [ "${{ github.event_name }}" != "pull_request" ]; then
|
|
echo "🚀 Deployed to Cloudflare Pages"
|
|
else
|
|
echo "🧪 Build test completed (no deployment for PR)"
|
|
fi |