From 1931957a3db5b5a9c304cd7492660251dce3fbd7 Mon Sep 17 00:00:00 2001 From: Jorge Macias Date: Fri, 1 Mar 2024 17:23:12 -0600 Subject: [PATCH] chore(update): CI/CD Include cleanup job to remove any available previous deployed site. --- .github/workflows/deploy.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fbe4821..ac305c6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,6 +15,17 @@ permissions: id-token: write jobs: + cleanup: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Delete previous deployments + uses: strumwolf/delete-deployment-environment@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + environment: github-pages + onlyRemoveDeployments: true + build: runs-on: ubuntu-latest steps: @@ -30,7 +41,7 @@ jobs: # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) deploy: - needs: build + needs: [cleanup, build] runs-on: ubuntu-latest environment: name: github-pages