geocrop-platform./.gitea/workflows/build-push.yaml

72 lines
2.0 KiB
YAML

name: Build and Push Docker Images
on:
push:
branches:
- main
paths:
- 'apps/worker/**'
- 'apps/api/**'
- 'apps/web/**'
jobs:
build-worker:
runs-on: ubuntu-latest
container: ubuntu-latest
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
- name: Build Worker with Kaniko
run: |
cat > /kaniko_executor << 'EOF'
#!/bin/sh
set -e
/kaniko/executor \
--dockerfile /workspace/apps/worker/Dockerfile \
--context /workspace \
--destination frankchine/geocrop-worker:latest \
--cache=true
EOF
chmod +x /kaniko_executor
/kaniko_executor
build-api:
runs-on: ubuntu-latest
container: ubuntu-latest
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
- name: Build API with Kaniko
run: |
/kaniko/executor \
--dockerfile /workspace/apps/api/Dockerfile \
--context /workspace \
--destination frankchine/geocrop-api:latest \
--cache=true
build-web:
runs-on: ubuntu-latest
container: ubuntu-latest
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
- name: Build Web with Kaniko
run: |
/kaniko/executor \
--dockerfile /workspace/apps/web/Dockerfile \
--context /workspace \
--destination frankchine/geocrop-web:latest \
--cache=true