Skip to content

Commit 6f9a85b

Browse files
authored
Merge pull request #7 from CFsylvester/github-actions-v3
GitHub actions v3
2 parents 1ede31b + 32ca083 commit 6f9a85b

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,13 @@ name: 🚨 CI Checks
33
on:
44
pull_request:
55
branches:
6-
- '**'
6+
- main
7+
- staging
78

89
jobs:
9-
check-main-override:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: 🛑 Block direct pushes to main (unless override flag)
13-
run: |
14-
echo "🔍 Event: ${{ github.event_name }} | Ref: ${{ github.ref }}"
15-
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
16-
COMMIT_MSG="${{ github.event.head_commit.message }}"
17-
echo "🔍 Commit message: $COMMIT_MSG"
18-
if [[ "$COMMIT_MSG" != *"[override-main]"* ]]; then
19-
echo "❌ Direct push to main is blocked. Use a PR or include [override-main] in your commit message."
20-
exit 1
21-
else
22-
echo "✅ Override flag found. Proceeding."
23-
fi
24-
else
25-
echo "ℹ️ Not a direct push to main. Proceeding."
26-
fi
27-
2810
lint:
2911
name: 🔍 Lint
3012
runs-on: ubuntu-latest
31-
needs: check-main-override
3213
steps:
3314
- uses: actions/checkout@v4
3415
- uses: actions/setup-node@v4
@@ -41,7 +22,6 @@ jobs:
4122
typecheck:
4223
name: ✅ Type Check
4324
runs-on: ubuntu-latest
44-
needs: check-main-override
4525
steps:
4626
- uses: actions/checkout@v4
4727
- uses: actions/setup-node@v4
@@ -54,7 +34,6 @@ jobs:
5434
build:
5535
name: 🔨 Build
5636
runs-on: ubuntu-latest
57-
needs: check-main-override
5837
steps:
5938
- uses: actions/checkout@v4
6039
- uses: actions/setup-node@v4
@@ -70,3 +49,10 @@ jobs:
7049
restore-keys: |
7150
next-${{ runner.os }}-
7251
- run: yarn build
52+
53+
ci:
54+
name: 🚨 CI Checks
55+
runs-on: ubuntu-latest
56+
needs: [lint, typecheck, build]
57+
steps:
58+
- run: echo "✅ All checks completed successfully."

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
- [Development Tools](#development-tools)
3434
- [Type Definitions](#type-definitions)
3535
- [Scripts](#scripts)
36+
- [CI & Deployments](#ci--deployments)
37+
- [CI Workflows Includes](#ci-workflow-includes)
38+
- [Vercel Deploy Flow](#-vercel-deploy-flow)
3639
- [Grid Overlay Toggle](#grid-overlay-toggle)
3740
- [Breakpoints Configuration](#breakpoints-configuration)
3841
- [Layout Root (Dynamic SCSS Variables)](#layout-root-dynamic-scss-variables)
@@ -204,6 +207,29 @@ Core styling configuration files:
204207
- `yarn lint:fix` - Fix ESLint errors
205208
- `yarn format` - Format code with Prettier
206209
- `yarn check-format` - Check code formatting
210+
- `yarn typecheck` - Check Typescript types
211+
212+
## CI & Deployments
213+
214+
[![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)
215+
216+
This template includes a built-in GitHub Actions workflow (`ci.yml`) that runs automatically on all pull requests and pushes to `main` and `staging`.
217+
218+
### CI Workflow Includes
219+
220+
- 🔍 Linting with ESLint
221+
- ✅ Type-checking with TypeScript
222+
- 🔨 Build verification (`next build`)
223+
224+
---
225+
226+
### 🌐 Vercel Deploy Flow
227+
228+
| Branch | Environment | Deployment |
229+
| ---------- | ----------- | --------------------------------- |
230+
| `main` | Production | ✅ Auto-deploy to prod |
231+
| `staging` | Staging | ✅ Auto-deploy to preview/staging |
232+
| feature PR | Preview | ✅ Deploy Preview via Vercel |
207233

208234
## Grid Overlay Toggle
209235

0 commit comments

Comments
 (0)