diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..cb9e8d58 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +name: Build + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Website build + runs-on: ubuntu-latest + + # Placeholder values only. `next build` needs these to be present and + # well-formed because a few modules construct clients at import time, but + # nothing here is contacted during the build. + env: + DATABASE_URL: postgresql://user:password@localhost:5432/db + DIRECT_URL: postgresql://user:password@localhost:5432/db + NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co + NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: placeholder-key + NEXT_PUBLIC_BASE_URL: http://localhost:3000 + NEXT_PUBLIC_REDIRECT_URL: http://localhost:3000/auth/callback + NEXT_PUBLIC_COLONY_URL: http://localhost:3000 + MAILGUN_DOMAIN: mg.example.com + MAILGUN_API_KEY: placeholder-key + NEWSLETTER_URI: http://localhost:3000/api/newsletter + NOTION_DB_ID: placeholder + NOTION_DB_SECRET: placeholder + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4.0.0 + with: + version: 10.14.0 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build