Skip to content
imlostincode
ENNL
Deployment kit

astro-k8s-deployment-kit

Shared deploy setup for Astro sites. Fix it once, and every site picks it up on its next update.

UnreleasedYou're reading the docs from main. Things here can change before the next release.Back to the latest release →
examples / main

workflows/cleanup-staging.yaml

View on GitHub ↗ (opens in a new tab)
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