Skip to content

Commit

Permalink
Publish to Static Sites (#2384)
Browse files Browse the repository at this point in the history
🔧 (workflows): add GitHub Actions workflow to clean up PR environments
Introduce a new GitHub Actions workflow to automatically clean up Azure
Static Web App environments when a pull request is closed. This ensures
that resources are not left running unnecessarily, which can help reduce
costs and maintain a clean environment. The workflow uses secrets for
authentication and skips unnecessary builds to optimize the cleanup
process.
  • Loading branch information
MrHinsh authored Sep 24, 2024
2 parents aa4680f + e7b487e commit 23fae28
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/close-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Azure Static Web App PR Cleanup

on:
pull_request:
types: [closed]

jobs:
pr_cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- name: Clean up pull request environment
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: 'close'
app_location: ''
skip_app_build: true
skip_api_build: true
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 23fae28

Please sign in to comment.