Files
marathon-todo/.gitea/workflows/redeploy-compose.yml
Oleksandr Shuryha 60c6d86d19
All checks were successful
Redeploy Docker Compose / redeploy (push) Successful in 15s
Use DEPLOY_PATH variable and add mount visibility checks
2026-03-26 19:24:02 +01:00

39 lines
1.0 KiB
YAML

name: Redeploy Docker Compose
on:
push:
branches:
- main
jobs:
redeploy:
runs-on: ubuntu-latest
env:
DEPLOY_PATH: ${{ vars.DEPLOY_PATH }}
DEPLOY_BRANCH: main
steps:
- name: Validate deployment path
shell: bash
run: |
set -euo pipefail
if [ -z "${DEPLOY_PATH:-}" ]; then
echo "Missing required variable: DEPLOY_PATH"
exit 1
fi
- name: Redeploy locally on runner host
shell: bash
run: |
set -euo pipefail
DEPLOY_PATH="$(printf '%s' "$DEPLOY_PATH" | tr -d '\r\n')"
echo "Using DEPLOY_PATH=<$DEPLOY_PATH>"
echo "Mounted parent path check:"
ls -ld /home/alshuriga/web-apps || true
ls -ld "$DEPLOY_PATH"
cd "$DEPLOY_PATH"
git fetch origin "$DEPLOY_BRANCH"
git checkout "$DEPLOY_BRANCH"
git pull --ff-only origin "$DEPLOY_BRANCH"
docker compose pull
docker compose up -d --build --remove-orphans