diff --git a/.github/workflows/deactivate-enviroments.yml b/.github/workflows/deactivate-enviroments.yml new file mode 100644 index 000000000..2b19b59c1 --- /dev/null +++ b/.github/workflows/deactivate-enviroments.yml @@ -0,0 +1,41 @@ +name: Deactivate Test + +on: + schedule: + - cron: '0 20 * * *' + workflow_dispatch: {} + +jobs: + deploy: + name: Deactivate Test + permissions: + id-token: write + contents: read + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Nomad + uses: lucasmelin/setup-nomad@v2.0.0 + + - name: Exchange GitHub JWT for Nomad token + uses: mikenomitch/nomad-jwt-auth@v0.1.0 + with: + url: https://nomad.bcdc.robojackets.net + jwtGithubAudience: https://nomad.bcdc.robojackets.net + methodName: GitHub + + - name: Stop test + env: + NOMAD_ADDR: https://nomad.bcdc.robojackets.net + continue-on-error: true + run: | + nomad stop apiary-test + + - name: Stop sandbox + env: + NOMAD_ADDR: https://nomad.bcdc.robojackets.net + continue-on-error: true + run: | + nomad stop apiary-sandbox