File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Manual Deploy
2+
3+ # Trigger via actions tab
4+ on :
5+ workflow_dispatch :
6+
7+ permissions :
8+ contents : read
9+
10+ jobs :
11+ deploy :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ # Step 1: Checkout the repository
16+ - name : Checkout repo
17+ uses : actions/checkout@v4
18+
19+ # Step 2: Connect to server via SSH and deploy
20+ - name : Deploy over SSH
21+ uses : appleboy/ssh-action@v1.2.0
22+ with :
23+ host : ${{ secrets.SSH_HOST }}
24+ username : ${{ secrets.SSH_USER }}
25+ key : ${{ secrets.SSH_KEY }}
26+ command_timeout : 10m
27+ script_stop : true
28+ script : |
29+
30+ # Crash out on error
31+ set -e
32+
33+ # CD to correct dir
34+ cd /root/server
35+
36+ # Ensure we are on the main branch
37+ git checkout main
38+
39+ # Pull changes from main
40+ git pull origin main
41+
42+ # Build and start container
43+ docker compose up --build --force-recreate --remove-orphans -d
You can’t perform that action at this time.
0 commit comments