CI/CD: use host-mode runner — direct deploy without SSH action
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Runner runs directly on aimpress server (ubuntu-latest:host). No need for appleboy/ssh-action Docker container. Each step runs shell commands directly on the deploy server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5491d2d73d
commit
0f11c2d201
1 changed files with 26 additions and 30 deletions
|
|
@ -9,37 +9,33 @@ jobs:
|
|||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
port: ${{ secrets.DEPLOY_PORT }}
|
||||
script: |
|
||||
set -euo pipefail
|
||||
DEPLOY_DIR="/opt/03-business/cohorta"
|
||||
- name: Pull latest code
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "=== Pulling latest code ==="
|
||||
git -C /opt/03-business/cohorta pull --ff-only
|
||||
git -C /opt/03-business/cohorta log --oneline -3
|
||||
|
||||
echo "=== Cohorta — auto deploy ==="
|
||||
- name: Ensure traefik-public network
|
||||
run: |
|
||||
docker network ls --format '{{.Name}}' | grep -q '^traefik-public$' \
|
||||
|| docker network create traefik-public
|
||||
|
||||
# Pull latest code
|
||||
git -C "$DEPLOY_DIR" pull --ff-only
|
||||
- name: Build and restart containers
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd /opt/03-business/cohorta
|
||||
docker compose build --no-cache frontend backend
|
||||
docker compose up -d --remove-orphans
|
||||
|
||||
# Ensure traefik-public network exists
|
||||
docker network ls --format '{{.Name}}' | grep -q '^traefik-public$' \
|
||||
|| docker network create traefik-public
|
||||
- name: Health check
|
||||
run: |
|
||||
echo "Waiting for backend..."
|
||||
for i in $(seq 1 30); do
|
||||
curl -sf http://localhost:5137/api/health > /dev/null 2>&1 && echo "✓ Backend healthy" && break
|
||||
sleep 3
|
||||
done
|
||||
docker compose -f /opt/03-business/cohorta/docker-compose.yml ps
|
||||
|
||||
# Build and restart containers
|
||||
cd "$DEPLOY_DIR"
|
||||
docker compose build --no-cache frontend backend
|
||||
docker compose up -d --remove-orphans
|
||||
|
||||
# Health check
|
||||
for i in $(seq 1 30); do
|
||||
curl -sf http://localhost:5137/api/health > /dev/null 2>&1 && echo "✓ Backend healthy" && break
|
||||
sleep 3
|
||||
done
|
||||
|
||||
docker compose ps
|
||||
echo "=== Deploy complete ==="
|
||||
echo " https://cohorta.ai-impress.com"
|
||||
- name: Done
|
||||
run: echo "=== Deploy complete === https://cohorta.ai-impress.com"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue