capsule AI-native Unix-like composition layer

src/.github/workflows/deploy-web.yml

1,755 bytes · 74 lines · capsule://quake0day/[email protected] raw on github

name: CI / Deploy

on:
  push:
    paths:
      - "app/**"
  pull_request:
    paths:
      - "app/**"

jobs:
  lint:
    name: Lint & Type Check
    runs-on: ubuntu-latest
    env:
      FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version-file: app/.nvmrc
          cache: yarn
          cache-dependency-path: app/yarn.lock

      - name: Install dependencies
        run: yarn install --frozen-lockfile
        working-directory: app

      - name: Prettier
        run: npx prettier --check .
        working-directory: app

      - name: ESLint
        run: yarn lint --max-warnings 0
        working-directory: app

      - name: Type check
        run: yarn type-check
        working-directory: app

  deploy:
    name: Build & Deploy
    needs: lint
    if: github.ref == 'refs/heads/cloudflare' && github.event_name == 'push'
    runs-on: ubuntu-latest
    env:
      FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version-file: app/.nvmrc
          cache: yarn
          cache-dependency-path: app/yarn.lock

      - name: Install dependencies
        run: yarn install --frozen-lockfile
        working-directory: app

      - name: Build
        run: yarn cf-build
        working-directory: app
        env:
          NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${{ secrets.NEXT_PUBLIC_TURNSTILE_SITE_KEY }}

      - name: Deploy
        run: yarn cf-deploy
        working-directory: app
        env:
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}