Add manual execution for CD
All checks were successful
Deploy to Pterodactyl / reinstall-server (push) Successful in 17s

This commit is contained in:
2026-08-19 15:14:20 +00:00
parent 0c84de6136
commit 6081b95d1d

View File

@@ -5,6 +5,18 @@ on:
branches:
- main
- master
workflow_dispatch:
# Optional: add inputs for manual overrides
inputs:
server_id:
description: 'Pterodactyl Server ID (overrides secret)'
required: false
type: string
branch:
description: 'Branch to deploy (if you have multiple)'
required: false
default: 'main'
type: string
jobs:
reinstall-server:
@@ -12,13 +24,21 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Call Pterodactyl API to reinstall server
env:
PTERODACTYL_URL: ${{ secrets.PTERODACTYL_URL }}
PTERODACTYL_API_KEY: ${{ secrets.PTERODACTYL_API_KEY }}
PTERODACTYL_SERVER_ID: ${{ secrets.PTERODACTYL_SERVER_ID }}
# Use manual input if provided, otherwise fall back to secret
PTERODACTYL_SERVER_ID: ${{ github.event.inputs.server_id || secrets.PTERODACTYL_SERVER_ID }}
run: |
if [ -z "$PTERODACTYL_SERVER_ID" ]; then
echo "ERROR: No server ID provided. Set secret PTERODACTYL_SERVER_ID or pass input 'server_id'."
exit 1
fi
curl -X POST "${{ env.PTERODACTYL_URL }}/api/application/servers/${{ env.PTERODACTYL_SERVER_ID }}/reinstall" \
-H "Authorization: Bearer ${{ env.PTERODACTYL_API_KEY }}" \
-H "Accept: application/json" \