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
1+ name : Update and restart STAFF server
22
3- # Trigger via actions tab
43on :
54 workflow_dispatch :
5+ inputs :
6+ branch :
7+ description : " Branch to deploy"
8+ required : true
9+ default : " main"
610
711permissions :
812 contents : read
1519 # Step 1: Checkout the repository
1620 - name : Checkout repo
1721 uses : actions/checkout@v4
22+ with :
23+ ref : ${{ github.event.inputs.branch }}
1824
1925 # Step 2: Connect to server via SSH and deploy
2026 - name : Deploy over SSH
@@ -26,18 +32,13 @@ jobs:
2632 command_timeout : 10m
2733 script_stop : true
2834 script : |
29-
30- # Crash out on error
3135 set -e
32-
33- # CD to correct dir
36+
3437 cd /root/staff-server
3538
36- # Ensure we are on the main branch
37- git checkout main
38-
39- # Pull changes from main
40- git pull origin main
39+ # Check out the selected branch based on chosen branch
40+ git fetch origin
41+ git checkout "${{ github.event.inputs.branch }}"
42+ git pull origin "${{ github.event.inputs.branch }}"
4143
42- # Build and start container
4344 docker compose up --build --force-recreate --remove-orphans -d
You can’t perform that action at this time.
0 commit comments