From bedad50550ff8e681d5f61437d8ee9340e7abca6 Mon Sep 17 00:00:00 2001 From: Claire Sylvester Date: Mon, 16 Jun 2025 10:04:51 -0700 Subject: [PATCH 1/5] add readme info --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 7697557..8759cb9 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ - [Development Tools](#development-tools) - [Type Definitions](#type-definitions) - [Scripts](#scripts) +- [CI & Deployments](#ci--deployments) + - [CI Workflows Includes](#ci-workflow-includes) + - [Vercel Deploy Flow](#-vercel-deploy-flow) - [Grid Overlay Toggle](#grid-overlay-toggle) - [Breakpoints Configuration](#breakpoints-configuration) - [Layout Root (Dynamic SCSS Variables)](#layout-root-dynamic-scss-variables) @@ -205,6 +208,33 @@ Core styling configuration files: - `yarn format` - Format code with Prettier - `yarn check-format` - Check code formatting +## CI & Deployments + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE) +[![CI Checks](https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE/actions/workflows/ci.yml/badge.svg)](https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE/actions/workflows/ci.yml) + +This template includes a built-in GitHub Actions workflow (`ci.yml`) that runs automatically on all pull requests and pushes to `main` and `staging`. + +### CI Workflow Includes + +- 🔍 Linting with ESLint +- ✅ Type-checking with TypeScript +- 🔨 Build verification (`next build`) +- 🛑 Main branch is protected — requires `[override-main]` in commit message to push directly + +> All CI checks must pass before merging into `main` or `staging`. +> Preview deployments are automatically handled by Vercel for all branches and PRs. + +--- + +### 🌐 Vercel Deploy Flow + +| Branch | Environment | Deployment | +| ---------- | ----------- | --------------------------------- | +| `main` | Production | ✅ Auto-deploy to prod | +| `staging` | Staging | ✅ Auto-deploy to preview/staging | +| feature PR | Preview | ✅ Deploy Preview via Vercel | + ## Grid Overlay Toggle ### Breakpoints Configuration From 490e2f862c590fd6244aec0273a67a43646d363d Mon Sep 17 00:00:00 2001 From: Claire Sylvester Date: Mon, 16 Jun 2025 11:26:19 -0700 Subject: [PATCH 2/5] remove button on ci check [override-main] --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8759cb9..0cb1cb6 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,6 @@ Core styling configuration files: ## CI & Deployments -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE) [![CI Checks](https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE/actions/workflows/ci.yml/badge.svg)](https://github.com/CFsylvester/next.js-tailwind-typescript-TEMPLATE/actions/workflows/ci.yml) This template includes a built-in GitHub Actions workflow (`ci.yml`) that runs automatically on all pull requests and pushes to `main` and `staging`. From 4961f010a063ea4c3e6f2e8e456d6715a01a8831 Mon Sep 17 00:00:00 2001 From: Claire Sylvester Date: Mon, 16 Jun 2025 11:31:37 -0700 Subject: [PATCH 3/5] [override-main] --- .github/workflows/ci.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58ffabe..ab9c690 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,23 @@ name: 🚨 CI Checks on: + push: + branches: + - main pull_request: branches: - - '**' + - main + - staging jobs: check-main-override: + if: github.event_name == 'push' runs-on: ubuntu-latest steps: - name: 🛑 Block direct pushes to main (unless override flag) run: | echo "🔍 Event: ${{ github.event_name }} | Ref: ${{ github.ref }}" - if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then COMMIT_MSG="${{ github.event.head_commit.message }}" echo "🔍 Commit message: $COMMIT_MSG" if [[ "$COMMIT_MSG" != *"[override-main]"* ]]; then @@ -22,13 +27,13 @@ jobs: echo "✅ Override flag found. Proceeding." fi else - echo "â„šī¸ Not a direct push to main. Proceeding." + echo "â„šī¸ Not a push to main — skipping override check." fi lint: name: 🔍 Lint + if: github.event_name == 'pull_request' runs-on: ubuntu-latest - needs: check-main-override steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -40,8 +45,8 @@ jobs: typecheck: name: ✅ Type Check + if: github.event_name == 'pull_request' runs-on: ubuntu-latest - needs: check-main-override steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -53,8 +58,8 @@ jobs: build: name: 🔨 Build + if: github.event_name == 'pull_request' runs-on: ubuntu-latest - needs: check-main-override steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From a68ec04ab67d6e817ec330cde68996c335822f75 Mon Sep 17 00:00:00 2001 From: Claire Sylvester Date: Mon, 16 Jun 2025 11:36:05 -0700 Subject: [PATCH 4/5] remove override main logic --- .github/workflows/ci.yml | 26 -------------------------- README.md | 5 +---- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab9c690..0b90828 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,38 +1,14 @@ name: 🚨 CI Checks on: - push: - branches: - - main pull_request: branches: - main - staging jobs: - check-main-override: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - name: 🛑 Block direct pushes to main (unless override flag) - run: | - echo "🔍 Event: ${{ github.event_name }} | Ref: ${{ github.ref }}" - if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then - COMMIT_MSG="${{ github.event.head_commit.message }}" - echo "🔍 Commit message: $COMMIT_MSG" - if [[ "$COMMIT_MSG" != *"[override-main]"* ]]; then - echo "❌ Direct push to main is blocked. Use a PR or include [override-main] in your commit message." - exit 1 - else - echo "✅ Override flag found. Proceeding." - fi - else - echo "â„šī¸ Not a push to main — skipping override check." - fi - lint: name: 🔍 Lint - if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -45,7 +21,6 @@ jobs: typecheck: name: ✅ Type Check - if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -58,7 +33,6 @@ jobs: build: name: 🔨 Build - if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 0cb1cb6..c76783c 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ Core styling configuration files: - `yarn lint:fix` - Fix ESLint errors - `yarn format` - Format code with Prettier - `yarn check-format` - Check code formatting +- `yarn typecheck` - Check Typescript types ## CI & Deployments @@ -219,10 +220,6 @@ This template includes a built-in GitHub Actions workflow (`ci.yml`) that runs a - 🔍 Linting with ESLint - ✅ Type-checking with TypeScript - 🔨 Build verification (`next build`) -- 🛑 Main branch is protected — requires `[override-main]` in commit message to push directly - -> All CI checks must pass before merging into `main` or `staging`. -> Preview deployments are automatically handled by Vercel for all branches and PRs. --- From 32ca083e20cdde74c5d0ba2bcbe5c487f2e70d15 Mon Sep 17 00:00:00 2001 From: Claire Sylvester Date: Mon, 16 Jun 2025 11:45:17 -0700 Subject: [PATCH 5/5] fix ci checks --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b90828..ed04136 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,10 @@ jobs: restore-keys: | next-${{ runner.os }}- - run: yarn build + + ci: + name: 🚨 CI Checks + runs-on: ubuntu-latest + needs: [lint, typecheck, build] + steps: + - run: echo "✅ All checks completed successfully."