From bd1fa0d96a02c1ccd96454dfaaa9fbd8ae381e06 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 5 Apr 2026 12:53:44 +0200 Subject: [PATCH] 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