Skip to content

Commit 1166263

Browse files
Release: Netlify_2025-12-25 (#10)
1 parent a1ef1ac commit 1166263

5 files changed

Lines changed: 58 additions & 2 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Enforce Dev-to-Main Pipeline"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-source-branch:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Verify source is dev
13+
if: github.head_ref != 'dev'
14+
run: |
15+
echo "STOP: You are trying to merge '${{ github.head_ref }}' directly into main."
16+
echo "All code must go through the 'dev' branch first."
17+
exit 1
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
6+
- dev
77

88
permissions:
99
contents: read
@@ -32,6 +32,8 @@ jobs:
3232

3333
- name: Build
3434
run: npm run build
35+
env:
36+
DEPLOY_TARGET: github-pages
3537

3638
- name: Setup Pages
3739
uses: actions/configure-pages@v4
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Deploy to Netlify
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
call-test:
9+
uses: ./.github/workflows/test.yml
10+
11+
deploy:
12+
runs-on: ubuntu-latest
13+
needs: [call-test]
14+
environment: netlify
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "24"
22+
- name: Install and Build
23+
run: |
24+
npm ci
25+
npm run build
26+
- name: Deploy to Netlify
27+
uses: netlify/actions/cli@master
28+
env:
29+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
30+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
31+
with:
32+
args: deploy --dir=dist --prod

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches:
66
- main
7+
- dev
8+
workflow_call:
79

810
jobs:
911
test:

vite.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import { fileURLToPath } from "node:url";
66

77
const __dirname = path.dirname(fileURLToPath(import.meta.url));
88

9+
// GitHub Pages (dev branch) uses "/chrisert/", Netlify (main branch) uses "/"
10+
const base = process.env.DEPLOY_TARGET === "github-pages" ? "/chrisert/" : "/";
11+
912
export default defineConfig({
10-
base: "/chrisert/",
13+
base,
1114
plugins: [react(), tailwindcss()],
1215
resolve: {
1316
alias: {

0 commit comments

Comments
 (0)