Skip to content

GitHub actions v3 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,13 @@ name: 🚨 CI Checks
on:
pull_request:
branches:
- '**'
- main
- staging

jobs:
check-main-override:
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
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 direct push to main. Proceeding."
fi

lint:
name: 🔍 Lint
runs-on: ubuntu-latest
needs: check-main-override
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -41,7 +22,6 @@ jobs:
typecheck:
name: ✅ Type Check
runs-on: ubuntu-latest
needs: check-main-override
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -54,7 +34,6 @@ jobs:
build:
name: 🔨 Build
runs-on: ubuntu-latest
needs: check-main-override
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -70,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."
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -204,6 +207,29 @@ 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

[![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`)

---

### 🌐 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

Expand Down