Skip to content

Merge branch 'feature/create-self-hosted-runner' of github.com:zenml-… #1

Merge branch 'feature/create-self-hosted-runner' of github.com:zenml-…

Merge branch 'feature/create-self-hosted-runner' of github.com:zenml-… #1

name: Destroy the test runner vm to azure
on:
workflow_call:
workflow_dispatch:
jobs:
destroy_test_vm:
name: Destroy VM to azure
runs-on: ubuntu-latest
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
MLSTACKS_ANALYTICS_OPT_IN=false

Check failure on line 16 in .github/workflows/destroy-self-hosted-runner.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/destroy-self-hosted-runner.yml

Invalid workflow file

You have an error in your yaml syntax on line 16
permissions:
contents: "read"
id-token: "write"
defaults:
run:
working-directory: ./infrastructure
steps:
- name: Checkout the Code
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Delete blob
run: |
az storage blob delete --account-name zenmlstorageaccount --container-name github-runner-tf --name ${{ github.run_id }}
- name: Check if any blobs left
id: check_blobs
run: |
blobs=$(az storage blob list --account-name zenmlstorageaccount --container-name github-runner-tf --prefix github-run --output tsv)
echo "BLOBS=$blobs" >> $GITHUB_ENV
- name: Destroy VM
run: terraform destroy -auto-approve -refresh=False
env:
TF_VAR_github_runner_token: ${{ secrets.runner_token }}
if: env.BLOBS == ''