-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (27 loc) · 884 Bytes
/
Copy pathdeploy.yml
File metadata and controls
33 lines (27 loc) · 884 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
31
32
33
name: CD - Deploy to VPS
on:
push:
branches: [ main ]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_SSH_KEY }}
port: ${{ secrets.VPS_PORT || 22 }}
script: |
# Navigate to your deployment folder on the VPS
cd /var/www/amz/codeaptor-server
# Pull the latest changes from Github
git pull origin main
# Rebuild and restart the Docker services in the background
docker compose build --no-cache app
docker compose down
docker compose up -d --build