-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (26 loc) · 816 Bytes
/
Copy pathdeploy.yml
File metadata and controls
30 lines (26 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Deploy to VPS
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy to VPS
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_SSH_KEY }}
port: ${{ secrets.VPS_PORT || 22 }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
git pull origin main
docker compose down
docker compose up -d --build
# Health check
echo "Waiting for container to be healthy..."
timeout 60 bash -c 'until curl -f http://localhost:3001/health; do sleep 2; done'
echo "Deployment successful!"