workflows/cleanup-staging.yaml
Bekijk op GitHub ↗ (opent in een nieuw tabblad)yaml
# Drop this into your project's .github/workflows/.
# Bump the @ref to pick up template updates.
name: Cleanup Staging Environments
on:
delete:
workflow_dispatch:
inputs:
environment_name:
description: 'Branch / environment name to remove (will be sanitized)'
required: false
type: string
jobs:
cleanup-deleted-branch:
if: github.event_name == 'delete' && github.event.ref_type == 'branch'
permissions:
contents: read
uses: NickMous/astro-k8s-deployment-kit/.github/workflows/[email protected]
with:
app-name: mysite
fleet-repo: NickMous/fleet-infra
branch-name: ${{ github.event.ref }}
secrets: inherit
manual-cleanup:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment_name != ''
permissions:
contents: read
uses: NickMous/astro-k8s-deployment-kit/.github/workflows/[email protected]
with:
app-name: mysite
fleet-repo: NickMous/fleet-infra
branch-name: ${{ github.event.inputs.environment_name }}
secrets: inherit