Some checks failed
Deploy / deploy (push) Has been cancelled
The self-hosted runner (gitea-act-runner-custom) lost node after image rebuild. Replace actions/checkout@v4 with plain git clone/reset. Also adds a guard to auto-rebuild the runner image if node is missing.
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Rebuild runner image if needed
|
|
run: |
|
|
if ! docker run --rm gitea-act-runner-custom:latest node --version > /dev/null 2>&1; then
|
|
docker build -t gitea-act-runner-custom:latest -f /home/deployer/gitea-runner.Dockerfile /home/deployer/
|
|
fi
|
|
|
|
- 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 & deploy
|
|
run: bash /home/deployer/deploy-ubigeo.sh
|
|
|
|
- name: Health check
|
|
run: curl -f https://api-ubigeo.darkcodex.dev/api/v1/health
|