Skip to content

automated-cleanup-resources #1112

automated-cleanup-resources

automated-cleanup-resources #1112

name: automated-cleanup-resources
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
pull_request:
branches:
- main
paths:
- .github/workflows/automated-cleanup-resources.yml
- infra/bootstrapping/**
- infra/scripts/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: check out repo
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: azure login
uses: azure/login@v1
with:
creds: ${{secrets.AZUREML_CREDENTIALS}}
enable-AzPSSession: true
continue-on-error: true
- name: "Install Az Modules"
shell: pwsh
run: |
Install-Module Az -Force; Import-Module Az -Force;
- name: setup-cli
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
working-directory: cli
continue-on-error: true
- name: Perform Cleanup
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash cleanup.sh
working-directory: infra/bootstrapping
continue-on-error: true
- name: Perform additional Cleanup
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
pwsh -File '${{ github.workspace }}/infra/scripts/call_all_scripts.ps1'