diff --git a/.github/workflows/orchestratorci-cleanup.yml b/.github/workflows/orchestratorci-cleanup.yml index 9c81eaf..656210a 100644 --- a/.github/workflows/orchestratorci-cleanup.yml +++ b/.github/workflows/orchestratorci-cleanup.yml @@ -3,14 +3,36 @@ name: OrchestratorCI on: workflow_call: inputs: - runner_id: + droplet_id: required: true type: string + + secrets: + DO_TOKEN: + required: true + + outputs: + done: + description: "The result of the orchestrator job" + value: ${{ jobs.cleanup.outputs.done }} # Gunakan jobs + jobs: - provisioning: + cleanup: runs-on: gitea-orchestrator name: OrchestratorCI Cleanup Job + outputs: + done: ${{ steps.cleanup.outputs.done }} # Sesuaikan nama steps: - - name: Run OrchestratorCI + - name: Run Cleanup OrchestratorCI + id: cleanup + env: + DROPLET_ID: ${{ inputs.droplet_id }} + DO_TOKEN: ${{ secrets.DO_TOKEN }} run: | - echo "Cleanup Sucess for runner_id: ${{ inputs.runner_id }}" \ No newline at end of file + wget https://github.com/digitalocean/doctl/releases/download/v1.141.0/doctl-1.141.0-linux-amd64.tar.gz + tar -xvf doctl-1.141.0-linux-amd64.tar.gz + mv doctl /usr/local/bin + + curl https://git.btwazure.com/btwedutech/workflows/raw/branch/main/orchestrator/cleanup.sh -o cleanup.sh + chmod +x cleanup.sh + ./cleanup.sh \ No newline at end of file