Skip to content

Commit

Permalink
chore(update): CI/CD
Browse files Browse the repository at this point in the history
Include cleanup job to remove any available previous deployed site.
  • Loading branch information
Jorgemacias-12 committed Mar 1, 2024
1 parent 2bf793b commit 1931957
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 1931957

Please sign in to comment.