64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
name: Web Frontend
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
paths:
|
|
- 'web/**'
|
|
- '.github/workflows/web.yml'
|
|
pull_request:
|
|
branches: [master, main]
|
|
paths:
|
|
- 'web/**'
|
|
- '.github/workflows/web.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint & Type Check
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run ESLint
|
|
run: npm run lint
|
|
- name: TypeScript type check
|
|
run: npx tsc --noEmit
|
|
|
|
deploy:
|
|
name: Deploy to Cloudflare
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
env:
|
|
CLOUDFLARE_ACCOUNT_ID: cf50f793171d7cb3b2ce23368b69cdcb
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build OpenNext bundle
|
|
run: npm run build && npx opennextjs-cloudflare build
|
|
- name: Deploy
|
|
run: npm run deploy
|