diff --git a/.github/workflows/update-and-restart-STAFF.yml b/.github/workflows/update-and-restart-STAFF.yml index 2b4e616..a557eb8 100644 --- a/.github/workflows/update-and-restart-STAFF.yml +++ b/.github/workflows/update-and-restart-STAFF.yml @@ -1,8 +1,12 @@ -name: Manual Deploy +name: Update and restart STAFF server -# Trigger via actions tab on: workflow_dispatch: + inputs: + branch: + description: "Branch to deploy" + required: true + default: "main" permissions: contents: read @@ -15,6 +19,8 @@ jobs: # Step 1: Checkout the repository - name: Checkout repo uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} # Step 2: Connect to server via SSH and deploy - name: Deploy over SSH @@ -26,18 +32,13 @@ jobs: command_timeout: 10m script_stop: true script: | - - # Crash out on error set -e - - # CD to correct dir + cd /root/staff-server - # Ensure we are on the main branch - git checkout main - - # Pull changes from main - git pull origin main + # Check out the selected branch based on chosen branch + git fetch origin + git checkout "${{ github.event.inputs.branch }}" + git pull origin "${{ github.event.inputs.branch }}" - # Build and start container docker compose up --build --force-recreate --remove-orphans -d diff --git a/.github/workflows/update-and-restart.yml b/.github/workflows/update-and-restart.yml index 1452dc0..c400369 100644 --- a/.github/workflows/update-and-restart.yml +++ b/.github/workflows/update-and-restart.yml @@ -1,4 +1,4 @@ -name: Manual Deploy +name: Update And Deploy PRODUCTION server # Trigger via actions tab on: