From 6081b95d1d2f517f06665932e83576ac1da89df4 Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Wed, 19 Aug 2026 15:14:20 +0000 Subject: [PATCH] Add manual execution for CD --- .gitea/workflows/deploy.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7bb08d6..58d742c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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" \