ci: use --volumes-from to share job container workspace with kaniko
Build and Deploy Chitfund / build-backend (push) Successful in 2m23s Details
Build and Deploy Chitfund / build-frontend (push) Successful in 1m11s Details

This commit is contained in:
deepkoluguri 2026-05-11 21:49:37 +00:00
parent 5a5e61a603
commit 5311eeb1b5
1 changed files with 21 additions and 10 deletions

View File

@ -7,31 +7,42 @@ jobs:
env: env:
DOCKER_HOST: tcp://172.17.0.1:2375 DOCKER_HOST: tcp://172.17.0.1:2375
steps: steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push Backend (Kaniko) - name: Build and push Backend (Kaniko)
run: | run: |
# Find this job container by its known name pattern
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
echo "Using volumes from: $JOB_CONTAINER"
docker run --rm \ docker run --rm \
--volumes-from "$JOB_CONTAINER" \
gcr.io/kaniko-project/executor:latest \ gcr.io/kaniko-project/executor:latest \
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \ --context=dir:///workspace/deepkoluguri/chitfund/backend \
--context-sub-path=backend \ --dockerfile=Dockerfile \
--git=branch=master,single-branch=true \
--destination=192.168.8.250:5000/chitfund-backend:latest \ --destination=192.168.8.250:5000/chitfund-backend:latest \
--insecure \ --insecure \
--skip-tls-verify \ --skip-tls-verify
--insecure-pull
build-frontend: build-frontend:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DOCKER_HOST: tcp://172.17.0.1:2375 DOCKER_HOST: tcp://172.17.0.1:2375
steps: steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push Frontend (Kaniko) - name: Build and push Frontend (Kaniko)
run: | run: |
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
echo "Using volumes from: $JOB_CONTAINER"
docker run --rm \ docker run --rm \
--volumes-from "$JOB_CONTAINER" \
gcr.io/kaniko-project/executor:latest \ gcr.io/kaniko-project/executor:latest \
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \ --context=dir:///workspace/deepkoluguri/chitfund/luckychit \
--context-sub-path=luckychit \ --dockerfile=Dockerfile \
--git=branch=master,single-branch=true \
--destination=192.168.8.250:5000/chitfund-frontend:latest \ --destination=192.168.8.250:5000/chitfund-frontend:latest \
--insecure \ --insecure \
--skip-tls-verify \ --skip-tls-verify
--insecure-pull