From 152bf4c755f506b42e1322b9f4b9ce94f4ad8048 Mon Sep 17 00:00:00 2001 From: Maximilian Kratz Date: Wed, 13 Mar 2024 13:54:38 +0100 Subject: [PATCH] Clean up old Vagrant and GitHub Actions artifacts on the runner Fixes a duplicate removal command --- .github/workflows/vagrant-up.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vagrant-up.yml b/.github/workflows/vagrant-up.yml index aba37b4..bf29bc0 100644 --- a/.github/workflows/vagrant-up.yml +++ b/.github/workflows/vagrant-up.yml @@ -28,11 +28,22 @@ jobs: group: Default labels: [self-hosted, Linux, X64] steps: - - name: clean up old VMs + - name: clean up old VirtualBox VMs run: | vboxmanage list vms | \ grep -o -P '(?<={).*(?=})' | \ while read line ; do vboxmanage unregistervm $line --delete ; done + - name: clean up old Vagrant artifacts + run: | + vagrant destroy emoflon + vagrant box remove gusztavvargadr/xubuntu-desktop-2204-lts + # https://stackoverflow.com/a/71346341 + - name: clean up old GitHub Actions runner build folder + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ - uses: actions/checkout@v4 - name: show Vagrant version run: vagrant --version @@ -42,7 +53,7 @@ jobs: echo "=> Vagrant run finished." env: GITHUB_TOKEN: ${{ github.token }} - - name: export virtualbox VM + - name: export VirtualBox VM run: | vagrant halt vboxmanage export emoflon -o emoflon.ovf