Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit f26e9cb

Browse files
add github action to auto deploy to server
1 parent 41ec28d commit f26e9cb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Deploy to Server
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Sync Files to Server
12+
uses: appleboy/ssh-action@v1.0.3
13+
with:
14+
key: ${{ secrets.SSH_KEY }}
15+
host: ${{ secrets.SERVER_HOST }}
16+
port: ${{ secrets.SERVER_PORT }}
17+
username: ${{ secrets.SERVER_USERNAME }}
18+
script: |
19+
cd ${{ secrets.SERVER_DIRECTORY }}
20+
git pull origin main --ff --no-edit

0 commit comments

Comments
 (0)