Skip to content

Commit 1c94891

Browse files
Merge pull request #18 from codebuilderinc/fix/video-watermark-offset
chore: offset video player position to hide watermarks
2 parents a797da1 + 6342833 commit 1c94891

21 files changed

Lines changed: 132 additions & 64 deletions

File tree

.github/workflows/cloudflare-pages-runtime.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
deploy-runtime:
1717
name: 🏗 Build and Deploy Runtime
1818
runs-on: ubuntu-latest
19+
env:
20+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1921

2022
steps:
2123
- name: 🔍 Checkout repository

.github/workflows/cloudflare-pages.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
deploy:
1717
name: 🏗 Build and Deploy
1818
runs-on: ubuntu-latest
19+
env:
20+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1921

2022
steps:
2123
- name: 🔍 Checkout repository
@@ -52,11 +54,24 @@ jobs:
5254
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5355
PROJECT_NAME: ${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }}
5456
run: |
55-
RESPONSE=$(curl -fsSL \
57+
echo "Checking variables..."
58+
echo "ACCOUNT_ID is set: $(if [ -n "$CLOUDFLARE_ACCOUNT_ID" ]; then echo "Yes (length: ${#CLOUDFLARE_ACCOUNT_ID})"; else echo "No"; fi)"
59+
echo "API_TOKEN is set: $(if [ -n "$CLOUDFLARE_API_TOKEN" ]; then echo "Yes (length: ${#CLOUDFLARE_API_TOKEN})"; else echo "No"; fi)"
60+
echo "PROJECT_NAME: $PROJECT_NAME"
61+
62+
RESPONSE=$(curl -s \
5663
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
5764
-H "Content-Type: application/json" \
5865
"https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects")
5966
67+
SUCCESS=$(printf '%s' "$RESPONSE" | jq -r '.success')
68+
if [ "$SUCCESS" != "true" ]; then
69+
echo "API Request Failed! The token might be invalid or lacking permissions."
70+
echo "Errors:"
71+
printf '%s' "$RESPONSE" | jq -r '.errors[]? | "\(.code): \(.message)"'
72+
exit 1
73+
fi
74+
6075
COUNT=$(printf '%s' "$RESPONSE" | jq '.result | length')
6176
MATCH=$(printf '%s' "$RESPONSE" | jq --arg name "$PROJECT_NAME" 'any(.result[]?; .name == $name)')
6277
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: '🚀 Deploy Next.js Docker App (Single Job)'
2+
3+
on:
4+
push:
5+
branches: [disabled]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: self-hosted
10+
name: '🐳 Build & Deploy'
11+
steps:
12+
- name: '🔍 Checkout Code'
13+
uses: actions/checkout@v3
14+
15+
# ========================
16+
# 🔐 Secrets & Config Setup
17+
# ========================
18+
- name: '🔒 Verify Secrets Exist'
19+
run: |
20+
if [ -z "${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}" ]; then
21+
echo "❌ Critical error: GOOGLE_SERVICES_JSON_BASE64 secret missing!"
22+
exit 1
23+
fi
24+
echo "✅ All secrets present"
25+
26+
- name: '📁 Create google-services.json'
27+
run: |
28+
echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > google-services.json
29+
echo "🔄 Validating JSON..."
30+
jq empty google-services.json # Requires jq installed
31+
env:
32+
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
33+
34+
- name: '⚙️ Create .env File'
35+
run: |
36+
echo "${{ secrets.ENV_FILE_CONTENT }}" > .env
37+
echo "" >> .env # Ensure trailing newline
38+
39+
# ========================
40+
# 🐳 Docker Operations
41+
# ========================
42+
- name: '🛠 Build Docker Image'
43+
run: docker build -t codebuilder-frontend:latest .
44+
45+
- name: '🗑 Cleanup Old Containers'
46+
run: |
47+
docker ps -aq --filter name=codebuilder-frontend | xargs -r docker rm -f
48+
49+
- name: '🚀 Launch New Container'
50+
run: |
51+
docker run -d \
52+
--network host \
53+
-p 3000:3000 \
54+
--env-file .env \
55+
--name codebuilder-frontend \
56+
codebuilder-frontend:latest

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
build-and-deploy:
99
runs-on: self-hosted
1010
name: '🐳 Build & Deploy'
11+
env:
12+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1113

1214
steps:
1315
- name: '🔍 Checkout Code'

.github/workflows/nextjs-static-gh-pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
build-and-deploy:
2020
name: 🏗 Build & Deploy
2121
runs-on: ubuntu-latest
22+
env:
23+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2224

2325
steps:
2426
- name: 🔍 Checkout repository

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const nextConfig = {
2828
assetPrefix: ghPagesBasePath ? `${ghPagesBasePath}/` : undefined,
2929

3030
allowedDevOrigins: [
31+
'https://codebuilder.org',
3132
'https://api.codebuilder.org',
3233
'https://new.codebuilder.org',
3334
'https://new.codebuilder.org:443',

public/sw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ self.addEventListener('push', (event) => {
55
const data = event.data.json()
66
const options = {
77
body: data.body,
8-
icon: data.icon || 'https://new.codebuilder.org/images/logo2.png', // Use a default icon if none is specified
9-
badge: data.badge || 'https://new.codebuilder.org/images/logo2.png',
8+
icon: data.icon || 'https://codebuilder.org/images/logo2.png', // Use a default icon if none is specified
9+
badge: data.badge || 'https://codebuilder.org/images/logo2.png',
1010
data: { url: data.url },
1111
}
1212

Binary file not shown.

src/app/about/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default function About() {
142142
return (
143143
<div className={`${Raleway.className}`}>
144144
{/* Banner with Video Background — pt offsets the fixed header */}
145-
<div className="relative w-full h-[420px] overflow-hidden">
145+
<div className="relative w-full h-[380px] overflow-hidden">
146146
{/* Video Background */}
147147
<div className="absolute inset-0">
148148
<div className="absolute inset-0 opacity-40">
@@ -157,7 +157,7 @@ export default function About() {
157157
</div>
158158

159159
{/* Banner Content — pt accounts for 74px fixed header */}
160-
<div className="relative z-10 flex items-center justify-center h-full pt-[74px] px-4">
160+
<div className="relative z-10 flex items-center justify-center h-full px-4 pt-10">
161161
<div className="text-center max-w-3xl mx-auto">
162162
<h2
163163
className={`text-white text-[28px] uppercase font-light mb-2 drop-shadow-md ${

src/app/api/notifications/mass-notification/route.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ export const POST = withLogging(async (request: NextRequest) => {
2121
title: `${title}`,
2222
body: body,
2323
url: url,
24-
icon: 'https://new.codebuilder.org/images/logo2.png',
25-
badge: 'https://new.codebuilder.org/images/logo2.png',
24+
icon: 'https://codebuilder.org/images/logo2.png',
25+
badge: 'https://codebuilder.org/images/logo2.png',
2626
}
2727

2828
// Loop and send notifications concurrently
29-
const notificationPromises = subscriptions.map((sub) =>
30-
sendNotification(sub, notificationPayload)
31-
)
29+
const notificationPromises = subscriptions.map((sub) => sendNotification(sub, notificationPayload))
3230

3331
// Wait for all notifications to complete
3432
await Promise.all(notificationPromises)

0 commit comments

Comments
 (0)