Skip to content

Commit 3724e4b

Browse files
Merge pull request #10 from codebuilderinc/feature/ui-overhaul-and-new-pages
UI Overhaul: New Pages, Redesigned Components & Assets
2 parents 51e2adf + 2ce3752 commit 3724e4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2857
-367
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 🧹 Cleanup GitHub Pages Preview
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
cleanup:
12+
name: 🗑 Remove Preview Deployment
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: 🔍 Checkout gh-pages branch
17+
uses: actions/checkout@v4
18+
with:
19+
ref: gh-pages
20+
fetch-depth: 1
21+
22+
- name: 🧹 Remove preview directory
23+
run: |
24+
BRANCH="${{ github.head_ref }}"
25+
SAFE_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
26+
PREVIEW_DIR="preview/${SAFE_BRANCH}"
27+
28+
if [ -d "$PREVIEW_DIR" ]; then
29+
echo "Removing preview directory: $PREVIEW_DIR"
30+
git config user.name "github-actions[bot]"
31+
git config user.email "github-actions[bot]@users.noreply.github.com"
32+
git rm -rf "$PREVIEW_DIR"
33+
git commit -m "🧹 Remove preview for closed PR #${{ github.event.pull_request.number }} ($BRANCH)"
34+
git push
35+
else
36+
echo "No preview directory found at $PREVIEW_DIR, skipping cleanup."
37+
fi

next.config.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ const isStaticExport = process.env.NEXT_OUTPUT_MODE === 'export'
66

77
console.log(`\n Next.js static export mode: ${isStaticExport}`)
88

9-
const repoName = 'codebuilder-frontend';
10-
const isGithubPages = !!process.env.GITHUB_PAGES;
9+
const repoName = 'codebuilder-frontend'
10+
const isGithubPages = !!process.env.GITHUB_PAGES
11+
// Set by the GitHub Pages workflow to support preview deployments in subdirectories.
12+
// e.g. "/codebuilder-frontend" for main, "/codebuilder-frontend/preview/my-branch" for previews.
13+
const ghPagesBasePath = process.env.NEXT_BASE_PATH || ''
1114

1215
const nextConfig = {
1316
/**
@@ -21,10 +24,16 @@ const nextConfig = {
2124

2225
// Conditionally set the output mode for the build.
2326
output: isStaticExport ? 'export' : undefined,
24-
//basePath: //isGithubPages ? `/${repoName}` : '',
25-
//assetPrefix: //isGithubPages ? `/${repoName}/` : '',
27+
basePath: ghPagesBasePath || undefined,
28+
assetPrefix: ghPagesBasePath ? `${ghPagesBasePath}/` : undefined,
2629

27-
allowedDevOrigins: ['https://api.codebuilder.org', 'https://new.codebuilder.org', 'https://new.codebuilder.org:443', 'https://dev.codebuilder.org', 'https://dev.codebuilder.org:443'], // resolves the CORS warning
30+
allowedDevOrigins: [
31+
'https://api.codebuilder.org',
32+
'https://new.codebuilder.org',
33+
'https://new.codebuilder.org:443',
34+
'https://dev.codebuilder.org',
35+
'https://dev.codebuilder.org:443',
36+
], // resolves the CORS warning
2837

2938
// Note: If you are using next/image, you may need to add an
3039
// unoptimized: true flag here if you are not using a custom loader.
@@ -65,7 +74,7 @@ const nextConfig = {
6574

6675
return config
6776
},
68-
} as unknown as NextConfig;
77+
} as unknown as NextConfig
6978

7079
// // Only include page.* files for static export, include route.* for all other builds
7180
// if (isStaticExport) {

public/images/portfolio/acs2.png

208 KB
Loading

public/images/portfolio/cdc.png

23.7 KB
Loading
30.3 KB
Loading
4.11 KB
Loading

public/images/portfolio/pifm.png

46.7 KB
Loading
8.89 KB
Loading
48.5 KB
Loading
86.2 KB
Loading

0 commit comments

Comments
 (0)