fix: simplify workflow with proper build args
All checks were successful
Build and Deploy / build (push) Successful in 0s
All checks were successful
Build and Deploy / build (push) Successful in 0s
This commit is contained in:
@@ -10,13 +10,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Trigger BuildKit Build
|
- name: Trigger BuildKit Build
|
||||||
run: |
|
run: |
|
||||||
echo "Building commit: \"\""
|
# Delete old job if exists
|
||||||
|
|
||||||
# Delete old job
|
|
||||||
kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true
|
kubectl delete job build-manoon-headless-action -n gitea --ignore-not-found=true 2>/dev/null || true
|
||||||
|
|
||||||
# Create build job
|
# Create build job with build args
|
||||||
cat << "JOBEOF" | kubectl apply -f -
|
cat << 'JOBEOF' | kubectl apply -f -
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
@@ -30,29 +28,30 @@ jobs:
|
|||||||
initContainers:
|
initContainers:
|
||||||
- name: clone
|
- name: clone
|
||||||
image: alpine/git:latest
|
image: alpine/git:latest
|
||||||
command:
|
command: ["sh", "-c"]
|
||||||
- sh
|
args:
|
||||||
- -c
|
- git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace
|
||||||
- |
|
|
||||||
set -e
|
|
||||||
git clone --depth 1 http://gitea:3000/unchained/manoon-headless.git /workspace
|
|
||||||
cd /workspace && git checkout \"\"
|
|
||||||
echo "Building: \"bd1fa0d\""
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
containers:
|
containers:
|
||||||
- name: build
|
- name: build
|
||||||
image: moby/buildkit:latest
|
image: moby/buildkit:latest
|
||||||
command:
|
command: ["sh", "-c"]
|
||||||
- sh
|
args:
|
||||||
- -c
|
|
||||||
- |
|
- |
|
||||||
set -e
|
|
||||||
mkdir -p /root/.docker
|
mkdir -p /root/.docker
|
||||||
cp /docker-config/.dockerconfigjson /root/.docker/config.json
|
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
|
buildctl --addr tcp://buildkit.gitea.svc.cluster.local:1234 build \
|
||||||
echo "Build complete!"
|
--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:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
@@ -67,5 +66,4 @@ jobs:
|
|||||||
secretName: ghcr-pull-secret
|
secretName: ghcr-pull-secret
|
||||||
JOBEOF
|
JOBEOF
|
||||||
|
|
||||||
echo "Build job created!"
|
echo "Build triggered!"
|
||||||
kubectl wait --for=condition=complete job/build-manoon-headless-action -n gitea --timeout=600s || echo "Build running in background"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user