Make deploy workflow skip missing app dir
Some checks failed
Deploy / deploy (push) Failing after 8s
Some checks failed
Deploy / deploy (push) Failing after 8s
This commit is contained in:
parent
c9a266317d
commit
2585085613
1 changed files with 4 additions and 6 deletions
|
|
@ -23,8 +23,6 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
echo "SSH setup: host=$SERVICE_HOST"
|
||||
|
||||
if ! command -v ssh >/dev/null 2>&1; then
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache openssh-client
|
||||
|
|
@ -47,9 +45,6 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Resolved IPv4: $SERVICE_HOST -> $SERVICE_IP"
|
||||
|
||||
echo "Checking TCP/22 reachability..."
|
||||
timeout 5 bash -lc "</dev/tcp/$SERVICE_IP/22" || {
|
||||
echo "ERROR: Cannot reach $SERVICE_HOST ($SERVICE_IP):22 from runner container" >&2
|
||||
exit 1
|
||||
|
|
@ -59,7 +54,6 @@ jobs:
|
|||
printf '%s\n' "$SERVICE_SSH_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
|
||||
echo "Fetching host key (ssh-keyscan)..."
|
||||
ssh-keyscan -4 -T 5 -H "$SERVICE_HOST" "$SERVICE_IP" >> ~/.ssh/known_hosts || {
|
||||
echo "ERROR: ssh-keyscan failed for $SERVICE_HOST ($SERVICE_IP)" >&2
|
||||
exit 1
|
||||
|
|
@ -73,6 +67,10 @@ jobs:
|
|||
APP_NAME="${{ github.event.repository.name }}"
|
||||
APP_PATH="/srv/apps/$APP_NAME"
|
||||
echo "Deploying $APP_NAME from $APP_PATH..."
|
||||
if [[ ! -d "$APP_PATH" ]]; then
|
||||
echo "Skipping deploy: $APP_PATH not found on this runner"
|
||||
exit 0
|
||||
fi
|
||||
cd "$APP_PATH"
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
|
|
|
|||
Loading…
Reference in a new issue