Skip to content

Commit f4915c2

Browse files
authored
Update workflow for STAFF server deployment
now has an option for what branch to use, as staff server wont always use `main`
1 parent 1c36558 commit f4915c2

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: Manual Deploy
1+
name: Update and restart STAFF server
22

3-
# Trigger via actions tab
43
on:
54
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: "Branch to deploy"
8+
required: true
9+
default: "main"
610

711
permissions:
812
contents: read
@@ -15,6 +19,8 @@ jobs:
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

0 commit comments

Comments
 (0)