Files
manoon-headless/.gitea/workflows/build.yaml
Unchained bea6aba014
All checks were successful
Build and Deploy / build (push) Successful in 0s
fix: simplify workflow with proper build args
2026-04-05 13:02:05 +02:00

70 lines
2.5 KiB
YAML

name: Build and Deploy
on:
push:
branches: [master, main]
jobs:
build:
runs-on: ubuntu-latest
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
metadata:
name: build-manoon-headless-action
namespace: gitea
spec:
ttlSecondsAfterFinished: 86400
template:
spec:
restartPolicy: Never
initContainers:
- name: clone
image: alpine/git:latest
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"]
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
- name: docker-config
mountPath: /docker-config
readOnly: true
volumes:
- name: workspace
emptyDir: {}
- name: docker-config
secret:
secretName: ghcr-pull-secret
JOBEOF
echo "Build triggered!"