Skip to content

nightly-cod-platform-destroy #85

nightly-cod-platform-destroy

nightly-cod-platform-destroy #85

name: nightly-cod-platform-destroy
on:
schedule:
- cron: "15 17 * * 1-5"
jobs:
nightly-cod-platform-destroy:
runs-on: "ubuntu-latest"
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Check the status of the latest nightly build
id: check-latest-nightly-status
uses: ./.github/actions/check-latest-nightly-status
- name: Destroy the potential Centreon-on-Demand nightly instance of the day
if: ${{ steps.check-latest-nightly-status.outputs.last_nightly_result == 'success' }}
run: |
set -x
echo "[INFO]: Destroying the nightly CoD instance of the day."
curl -X POST \
-H "Authorization: Bearer ${{ secrets.CENTREON_TECHNIQUE_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/centreon/centreon-on-demand/dispatches \
-d '{"event_type": "destroy-nightly-platform",
"client_payload": {
"workspace_to_destroy_id": "0",
"confirm": true
}
}'
shell: bash