ci: use --volumes-from to share job container workspace with kaniko
This commit is contained in:
parent
5a5e61a603
commit
5311eeb1b5
|
|
@ -7,31 +7,42 @@ jobs:
|
|||
env:
|
||||
DOCKER_HOST: tcp://172.17.0.1:2375
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and push Backend (Kaniko)
|
||||
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 \
|
||||
--volumes-from "$JOB_CONTAINER" \
|
||||
gcr.io/kaniko-project/executor:latest \
|
||||
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \
|
||||
--context-sub-path=backend \
|
||||
--git=branch=master,single-branch=true \
|
||||
--context=dir:///workspace/deepkoluguri/chitfund/backend \
|
||||
--dockerfile=Dockerfile \
|
||||
--destination=192.168.8.250:5000/chitfund-backend:latest \
|
||||
--insecure \
|
||||
--skip-tls-verify \
|
||||
--insecure-pull
|
||||
--skip-tls-verify
|
||||
|
||||
build-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_HOST: tcp://172.17.0.1:2375
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and push Frontend (Kaniko)
|
||||
run: |
|
||||
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
|
||||
echo "Using volumes from: $JOB_CONTAINER"
|
||||
|
||||
docker run --rm \
|
||||
--volumes-from "$JOB_CONTAINER" \
|
||||
gcr.io/kaniko-project/executor:latest \
|
||||
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \
|
||||
--context-sub-path=luckychit \
|
||||
--git=branch=master,single-branch=true \
|
||||
--context=dir:///workspace/deepkoluguri/chitfund/luckychit \
|
||||
--dockerfile=Dockerfile \
|
||||
--destination=192.168.8.250:5000/chitfund-frontend:latest \
|
||||
--insecure \
|
||||
--skip-tls-verify \
|
||||
--insecure-pull
|
||||
--skip-tls-verify
|
||||
Loading…
Reference in New Issue