Files
api-ubigeo/.github/workflows/deploy.yml
Gianpierre Mio e3a89e82a2
Some checks failed
Deploy / deploy (push) Failing after 3m39s
fix: inline deploy steps — remove dependency on deploy-ubigeo.sh
Script used docker-compose (v1 syntax), runner has docker compose (v2).
Now builds image and runs compose directly in workflow steps.
2026-03-10 08:42:19 -05:00

44 lines
1.2 KiB
YAML

name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout
run: |
if [ ! -d /workspace/darkcodex/api-ubigeo/.git ]; then
git clone https://948ee86882f8d9ca46eb94750addfccdace443a6@git.darkcodex.dev/darkcodex/api-ubigeo.git \
/workspace/darkcodex/api-ubigeo
fi
cd /workspace/darkcodex/api-ubigeo
git fetch origin main
git reset --hard origin/main
- name: Sync source
run: |
rsync -a --delete \
--exclude='.git' \
--exclude='node_modules' \
--exclude='dist' \
--exclude='.env' \
/workspace/darkcodex/api-ubigeo/ /home/deployer/api-ubigeo/
- name: Build image
run: |
cd /home/deployer/api-ubigeo
docker build -t ubigeo-api:latest .
- name: Deploy containers
run: |
cd /home/deployer/api-ubigeo
docker compose -f docker-compose.production.yml up -d --remove-orphans
- name: Health check
run: |
sleep 10
curl -f https://api-ubigeo.darkcodex.dev/api/v1/health