Skip to content

Commit 919d4e9

Browse files
committed
Update action workflows
1 parent 82f31ec commit 919d4e9

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
name: Backend CD
1+
name: Backend Deployment
22
on:
33
push:
44
paths:
55
- 'backend/**'
6+
- '.github/workflows/backend.yml'
7+
branches: [main]
8+
69
jobs:
710
deploy:
811
runs-on: ubuntu-latest
912
steps:
10-
- uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
1118
- name: Deploy via SSH
1219
uses: appleboy/ssh-action@v1
1320
with:
14-
host: 147.45.139.11
15-
username: root
21+
host: ${{ secrets.SERVER_IP }}
22+
username: ${{ secrets.SERVER_USER }}
1623
key: ${{ secrets.SERVER_SSH_KEY }}
1724
script: |
1825
cd /opt/cookieless/backend
19-
git pull origin main
26+
git fetch origin main
27+
git reset --hard origin/main
2028
docker-compose down
2129
docker-compose up -d --build

0 commit comments

Comments
 (0)