-
Notifications
You must be signed in to change notification settings - Fork 31
37 lines (35 loc) · 1.29 KB
/
destroy-hosted-runner.yaml
File metadata and controls
37 lines (35 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: destroy-hosted-runner
on:
workflow_call:
inputs:
operating_system:
required: true
type: string
jobs:
remove_cloud_instance:
runs-on: ubuntu-24.04
steps:
- name: Download mapt image from artifacts
uses: actions/download-artifact@v7
with:
name: mapt
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- name: Import mapt image
run: |
podman load -i mapt-amd64.tar
podman images
- name: Destroy instance
run: |
MAPT_IMAGE=$(cat mapt-image)
podman run --name mapt-destroy --rm \
-v ${PWD}:/workspace:z \
-e ARM_CLIENT_ID=${{secrets.ARM_CLIENT_ID}} \
-e ARM_CLIENT_SECRET=${{secrets.ARM_CLIENT_SECRET}} \
-e ARM_TENANT_ID=${{secrets.ARM_TENANT_ID}} \
-e ARM_SUBSCRIPTION_ID=${{secrets.ARM_SUBSCRIPTION_ID}} \
-e AZURE_STORAGE_ACCOUNT=${{secrets.AZURE_STORAGE_ACCOUNT}} \
-e AZURE_STORAGE_KEY=${{secrets.AZURE_STORAGE_KEY}} \
${MAPT_IMAGE} azure ${{inputs.operating_system}} \
destroy --project-name "az-ghrunner" \
--backed-url "azblob://mapt-gh-runner-mapt-state/${{ github.repository }}-${{ github.run_id }}"