All checks were successful
Deploy to Pterodactyl / reinstall-server (push) Successful in 17s
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
name: Deploy to Pterodactyl
|
|
|
|
on:
|
|
push:
|
|
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:
|
|
runs-on: ubuntu-latest
|
|
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 }}
|
|
# 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" \
|
|
-H "Content-Type: application/json"
|