From d53665d6da384ba367401130de7975861b26885a Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:24:01 +0200 Subject: [PATCH 01/14] build: pass env vars as build args to fix localhost:8000 error - Add ARG and ENV directives to Dockerfile for NEXT_PUBLIC_* vars - Pass build args in buildctl command with --opt build-arg - Fixes ERR_BLOCKED_BY_CLIENT on localhost:8000/graphql --- .gitea/workflows/build.yaml | 7 ++++++- Dockerfile | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 472e7a6..a5036d7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -54,8 +54,13 @@ jobs: --frontend dockerfile.v0 \ --local context=/workspace \ --local dockerfile=/workspace \ + --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ \ + --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com \ + --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - kubectl annotate kustomization -n flux-system manoonoils-storefront --overwrite reconcile.fluxcd.io/requestedAt="\1775369769" + kubectl annotate kustomization -n flux-system manoonoils-storefront --overwrite reconcile.fluxcd.io/requestedAt="$(date +%s)" echo "Done!" volumeMounts: - name: workspace diff --git a/Dockerfile b/Dockerfile index 60f1c74..4110870 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,25 @@ -# Multi-stage build for Next.js FROM node:20-slim AS builder WORKDIR /app -# Copy package files +ARG NEXT_PUBLIC_SALEOR_API_URL +ARG NEXT_PUBLIC_SITE_URL +ARG NEXT_PUBLIC_OPENPANEL_CLIENT_ID +ARG NEXT_PUBLIC_RYBBIT_HOST +ARG NEXT_PUBLIC_RYBBIT_SITE_ID + +ENV NEXT_PUBLIC_SALEOR_API_URL=${NEXT_PUBLIC_SALEOR_API_URL} +ENV NEXT_PUBLIC_SITE_URL=${NEXT_PUBLIC_SITE_URL} +ENV NEXT_PUBLIC_OPENPANEL_CLIENT_ID=${NEXT_PUBLIC_OPENPANEL_CLIENT_ID} +ENV NEXT_PUBLIC_RYBBIT_HOST=${NEXT_PUBLIC_RYBBIT_HOST} +ENV NEXT_PUBLIC_RYBBIT_SITE_ID=${NEXT_PUBLIC_RYBBIT_SITE_ID} + COPY package*.json ./ RUN npm install --prefer-offline --no-audit -# Copy source and build COPY . . RUN npm run build -# Production stage FROM node:20-slim AS runner WORKDIR /app @@ -20,7 +28,6 @@ ENV NODE_ENV=production ENV PORT=3000 ENV HOSTNAME=0.0.0.0 -# Copy necessary files from builder COPY --from=builder /app/public ./public COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static From bdc35ff2b4c0f047baa7629b88f19505547add31 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:31:59 +0200 Subject: [PATCH 02/14] fix: remove quotes from date command in build workflow --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a5036d7..cd2a5de 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -60,7 +60,7 @@ jobs: --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - kubectl annotate kustomization -n flux-system manoonoils-storefront --overwrite reconcile.fluxcd.io/requestedAt="$(date +%s)" + kubectl annotate kustomization -n flux-system manoonoils-storefront --overwrite reconcile.fluxcd.io/requestedAt=$(date +%s) echo "Done!" volumeMounts: - name: workspace From 05b2c266340826c414972364e741f2184391d16c Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:35:01 +0200 Subject: [PATCH 03/14] fix: correct syntax errors in build workflow - Fix unclosed quote on line 13 - Remove malformed git checkout command on line 39 --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index cd2a5de..00383fc 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Trigger BuildKit Build run: | - echo "Building commit: \" + echo "Building commit: ${GITHUB_SHA}" # Delete old job kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true @@ -36,7 +36,7 @@ jobs: - | set -e git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace - cd /workspace && git checkout echo "Building: $(git rev-parse --short HEAD)" + cd /workspace && echo "Building: $(git rev-parse --short HEAD)" volumeMounts: - name: workspace mountPath: /workspace From cdbcd8424bacb531bf277b40b0ed51f0a1752529 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:39:39 +0200 Subject: [PATCH 04/14] fix: improve git clone error handling in build workflow --- .gitea/workflows/build.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 00383fc..a663ae0 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -35,8 +35,15 @@ jobs: - -c - | set -e + echo "Cloning repository..." + rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace - cd /workspace && echo "Building: $(git rev-parse --short HEAD)" + if [ ! -d /workspace/.git ]; then + echo "ERROR: Clone failed - .git directory not found" + exit 1 + fi + cd /workspace + echo "Successfully cloned: $(git rev-parse --short HEAD)" volumeMounts: - name: workspace mountPath: /workspace From 6563f0c966e10574b2a247a05cdfe063c583d07b Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:43:57 +0200 Subject: [PATCH 05/14] fix: use full cluster DNS for gitea service - Change gitea URL from http://gitea:3000 to http://gitea.gitea.svc.cluster.local:3000 - Add set -x for debugging - Add explicit clone exit code checking --- .gitea/workflows/build.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a663ae0..984928d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -34,10 +34,16 @@ jobs: - sh - -c - | - set -e + set -ex echo "Cloning repository..." rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true - git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace + CLONE_OUTPUT=$(git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace 2>&1) + CLONE_EXIT_CODE=$? + echo "$CLONE_OUTPUT" + if [ $CLONE_EXIT_CODE -ne 0 ]; then + echo "ERROR: Clone failed with exit code $CLONE_EXIT_CODE" + exit 1 + fi if [ ! -d /workspace/.git ]; then echo "ERROR: Clone failed - .git directory not found" exit 1 From 7c7611b723194a72983be2dcfbf98bc04f204b79 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 11:50:23 +0200 Subject: [PATCH 06/14] fix: simplify build workflow YAML syntax - Use 'command' and 'args' instead of multiline command - Use quoted heredoc delimiter to prevent variable expansion - Simplify clone and build scripts --- .gitea/workflows/build.yaml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 984928d..9f8e5c9 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true # Create build job - kubectl apply -f - << EOF + cat << 'JOBEOF' | kubectl apply -f - apiVersion: batch/v1 kind: Job metadata: @@ -30,24 +30,14 @@ jobs: initContainers: - name: clone image: alpine/git:latest - command: - - sh - - -c + workingDir: /workspace + command: ["/bin/sh", "-c"] + args: - | set -ex echo "Cloning repository..." rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true - CLONE_OUTPUT=$(git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace 2>&1) - CLONE_EXIT_CODE=$? - echo "$CLONE_OUTPUT" - if [ $CLONE_EXIT_CODE -ne 0 ]; then - echo "ERROR: Clone failed with exit code $CLONE_EXIT_CODE" - exit 1 - fi - if [ ! -d /workspace/.git ]; then - echo "ERROR: Clone failed - .git directory not found" - exit 1 - fi + git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace cd /workspace echo "Successfully cloned: $(git rev-parse --short HEAD)" volumeMounts: @@ -56,9 +46,8 @@ jobs: containers: - name: build image: moby/buildkit:latest - command: - - sh - - -c + command: ["/bin/sh", "-c"] + args: - | set -e mkdir -p /root/.docker @@ -87,7 +76,7 @@ jobs: - name: docker-config secret: secretName: ghcr-pull-secret - EOF + JOBEOF echo "Build job created!" - kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background" + kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background" \ No newline at end of file From 09b06146952351e10872471a1b23227c85312310 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:03:27 +0200 Subject: [PATCH 07/14] fix: remove kubectl annotate from build workflow - Remove kubectl command that was causing build failures - Flux will auto-detect new image within 5 minutes via polling - Simpler, more reliable build process --- .gitea/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 9f8e5c9..9f1ed81 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -62,8 +62,7 @@ jobs: --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - kubectl annotate kustomization -n flux-system manoonoils-storefront --overwrite reconcile.fluxcd.io/requestedAt=$(date +%s) - echo "Done!" + echo "Build complete! Image pushed to GHCR." volumeMounts: - name: workspace mountPath: /workspace From 826d1ebb46d6811b802b868776b70e93d7d12b62 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:30:07 +0200 Subject: [PATCH 08/14] trigger: rebuild with correct env vars Previous build had localhost:8000 hardcoded. This rebuild uses the fixed Dockerfile with build args. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8cb5b6c..275e455 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,4 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/bui // Auto-deploy test: 2026-03-07T10:33:23Z // Auto-deploy test 2: 2026-03-07T10:37:05Z # Trigger build Sun Apr 5 06:32:05 AM EET 2026 +# Trigger build with env vars Sun Apr 5 08:45:00 AM EET 2026 From bd1fa0d96a02c1ccd96454dfaaa9fbd8ae381e06 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:53:44 +0200 Subject: [PATCH 09/14] test: add no-cache build workflow --- .gitea/workflows/build-test.yaml | 77 ++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .gitea/workflows/build-test.yaml diff --git a/.gitea/workflows/build-test.yaml b/.gitea/workflows/build-test.yaml new file mode 100644 index 0000000..02f9945 --- /dev/null +++ b/.gitea/workflows/build-test.yaml @@ -0,0 +1,77 @@ +name: Build Test (No Cache) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Trigger BuildKit Build (No Cache) + run: | + echo "Building with no cache..." + + kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true + + cat << 'JOBEOF' | kubectl apply -f - + apiVersion: batch/v1 + kind: Job + metadata: + name: build-manoon-headless-action + namespace: gitea + spec: + ttlSecondsAfterFinished: 86400 + template: + spec: + restartPolicy: Never + initContainers: + - name: clone + image: alpine/git:latest + command: ["/bin/sh", "-c"] + args: + - | + set -ex + rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true + git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace + cd /workspace + echo "Cloned: $(git rev-parse --short HEAD)" + volumeMounts: + - name: workspace + mountPath: /workspace + containers: + - name: build + image: moby/buildkit:latest + command: ["/bin/sh", "-c"] + args: + - | + set -e + mkdir -p /root/.docker + cp /docker-config/.dockerconfigjson /root/.docker/config.json + # Build with no cache to force fresh build + buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build \ + --frontend dockerfile.v0 \ + --local context=/workspace \ + --local dockerfile=/workspace \ + --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ \ + --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com \ + --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ + --opt no-cache=true \ + --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true + echo "Build complete!" + volumeMounts: + - name: workspace + mountPath: /workspace + - name: docker-config + mountPath: /docker-config + readOnly: true + volumes: + - name: workspace + emptyDir: {} + - name: docker-config + secret: + secretName: ghcr-pull-secret + JOBEOF + + kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s From 9c04dffa46d2d6f004d34f8fbcaaf08f8025b3a9 Mon Sep 17 00:00:00 2001 From: Flux CD Date: Sun, 5 Apr 2026 10:58:54 +0000 Subject: [PATCH 10/14] fix: add missing build args to workflow --- .gitea/workflows/build.yaml | 40 ++++++++++++++----------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 9f1ed81..cb9ceaa 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,13 +10,13 @@ jobs: steps: - name: Trigger BuildKit Build run: | - echo "Building commit: ${GITHUB_SHA}" + echo "Building commit: \"\"" # Delete old job kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true # Create build job - cat << 'JOBEOF' | kubectl apply -f - + cat << "JOBEOF" | kubectl apply -f - apiVersion: batch/v1 kind: Job metadata: @@ -30,39 +30,29 @@ jobs: initContainers: - name: clone image: alpine/git:latest - workingDir: /workspace - command: ["/bin/sh", "-c"] - args: + command: + - sh + - -c - | - set -ex - echo "Cloning repository..." - rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true - git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace - cd /workspace - echo "Successfully cloned: $(git rev-parse --short HEAD)" + set -e + git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace + cd /workspace && git checkout \"\" + echo "Building: \"bd1fa0d\"" volumeMounts: - name: workspace mountPath: /workspace containers: - name: build image: moby/buildkit:latest - command: ["/bin/sh", "-c"] - args: + command: + - sh + - -c - | set -e mkdir -p /root/.docker cp /docker-config/.dockerconfigjson /root/.docker/config.json - buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build \ - --frontend dockerfile.v0 \ - --local context=/workspace \ - --local dockerfile=/workspace \ - --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ \ - --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com \ - --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ - --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ - --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ - --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - echo "Build complete! Image pushed to GHCR." + buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build --frontend dockerfile.v0 --local context=/workspace --local dockerfile=/workspace --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true + echo "Build complete!" volumeMounts: - name: workspace mountPath: /workspace @@ -78,4 +68,4 @@ jobs: JOBEOF echo "Build job created!" - kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background" \ No newline at end of file + kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background" From 38defdfb9b7f90cdd2965762703b04a0fdc6c9c0 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:59:03 +0200 Subject: [PATCH 11/14] chore: remove test workflow --- .gitea/workflows/build-test.yaml | 77 -------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 .gitea/workflows/build-test.yaml diff --git a/.gitea/workflows/build-test.yaml b/.gitea/workflows/build-test.yaml deleted file mode 100644 index 02f9945..0000000 --- a/.gitea/workflows/build-test.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build Test (No Cache) - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Trigger BuildKit Build (No Cache) - run: | - echo "Building with no cache..." - - kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true - - cat << 'JOBEOF' | kubectl apply -f - - apiVersion: batch/v1 - kind: Job - metadata: - name: build-manoon-headless-action - namespace: gitea - spec: - ttlSecondsAfterFinished: 86400 - template: - spec: - restartPolicy: Never - initContainers: - - name: clone - image: alpine/git:latest - command: ["/bin/sh", "-c"] - args: - - | - set -ex - rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true - git clone --depth 1 http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git /workspace - cd /workspace - echo "Cloned: $(git rev-parse --short HEAD)" - volumeMounts: - - name: workspace - mountPath: /workspace - containers: - - name: build - image: moby/buildkit:latest - command: ["/bin/sh", "-c"] - args: - - | - set -e - mkdir -p /root/.docker - cp /docker-config/.dockerconfigjson /root/.docker/config.json - # Build with no cache to force fresh build - buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build \ - --frontend dockerfile.v0 \ - --local context=/workspace \ - --local dockerfile=/workspace \ - --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ \ - --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com \ - --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ - --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ - --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ - --opt no-cache=true \ - --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - echo "Build complete!" - volumeMounts: - - name: workspace - mountPath: /workspace - - name: docker-config - mountPath: /docker-config - readOnly: true - volumes: - - name: workspace - emptyDir: {} - - name: docker-config - secret: - secretName: ghcr-pull-secret - JOBEOF - - kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s From 8454ffc5b39f18aa7572df4c174d66d81c2a424a Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:59:49 +0200 Subject: [PATCH 12/14] test: trigger build with args --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 275e455..675d4ad 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,4 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/bui // Auto-deploy test 2: 2026-03-07T10:37:05Z # Trigger build Sun Apr 5 06:32:05 AM EET 2026 # Trigger build with env vars Sun Apr 5 08:45:00 AM EET 2026 +# Build test Sun Apr 5 12:59:49 PM EET 2026 From bea6aba01448f0a8c4eece174621c007db9434c7 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 13:02:05 +0200 Subject: [PATCH 13/14] fix: simplify workflow with proper build args --- .gitea/workflows/build.yaml | 46 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index cb9ceaa..90b565f 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,13 +10,11 @@ jobs: steps: - name: Trigger BuildKit Build run: | - echo "Building commit: \"\"" - - # Delete old job + # Delete old job if exists kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true - # Create build job - cat << "JOBEOF" | kubectl apply -f - + # Create build job with build args + cat << 'JOBEOF' | kubectl apply -f - apiVersion: batch/v1 kind: Job metadata: @@ -30,29 +28,30 @@ jobs: initContainers: - name: clone image: alpine/git:latest - command: - - sh - - -c - - | - set -e - git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace - cd /workspace && git checkout \"\" - echo "Building: \"bd1fa0d\"" + command: ["sh", "-c"] + args: + - git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace volumeMounts: - name: workspace mountPath: /workspace containers: - name: build image: moby/buildkit:latest - command: - - sh - - -c - - | - set -e - mkdir -p /root/.docker - cp /docker-config/.dockerconfigjson /root/.docker/config.json - buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build --frontend dockerfile.v0 --local context=/workspace --local dockerfile=/workspace --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true - echo "Build complete!" + command: ["sh", "-c"] + args: + - | + mkdir -p /root/.docker + cp /docker-config/.dockerconfigjson /root/.docker/config.json + buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build \ + --frontend dockerfile.v0 \ + --local context=/workspace \ + --local dockerfile=/workspace \ + --opt build-arg:NEXT_PUBLIC_SALEOR_API_URL=https://api.manoonoils.com/graphql/ \ + --opt build-arg:NEXT_PUBLIC_SITE_URL=https://manoonoils.com \ + --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ + --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ + --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true volumeMounts: - name: workspace mountPath: /workspace @@ -67,5 +66,4 @@ jobs: secretName: ghcr-pull-secret JOBEOF - echo "Build job created!" - kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background" + echo "Build triggered!" From 2097280f208bb841931f376e8cb3a8a3b99977b6 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 13:05:28 +0200 Subject: [PATCH 14/14] fix: force no-cache build --- .gitea/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 90b565f..d3ee648 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,10 +10,8 @@ jobs: steps: - name: Trigger BuildKit Build run: | - # Delete old job if exists kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true - # Create build job with build args cat << 'JOBEOF' | kubectl apply -f - apiVersion: batch/v1 kind: Job @@ -51,6 +49,7 @@ jobs: --opt build-arg:NEXT_PUBLIC_OPENPANEL_CLIENT_ID=fa61f8ae-0b5d-4187-a9b1-5a04b0025674 \ --opt build-arg:NEXT_PUBLIC_RYBBIT_HOST=https://rybbit.nodecrew.me \ --opt build-arg:NEXT_PUBLIC_RYBBIT_SITE_ID=1 \ + --no-cache \ --output type=image,name=ghcr.io/unchainedio/manoon-headless:latest,push=true volumeMounts: - name: workspace