initial commit
deploy / deploy (push) Successful in 4m48s

Change-Id: If4e8a826d76819817e111cc7477a135f0c871db9
This commit is contained in:
Scaffolder
2026-05-13 18:29:35 +00:00
commit 59c9a95154
13 changed files with 791 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
name: destroy
on:
workflow_dispatch:
inputs:
confirm_destroy:
description: "Type the repository name to confirm destroy"
required: true
default: ""
jobs:
destroy:
runs-on:
- toolzoo-host
env:
AWS_REGION: us-east-1
APP_STACK_PREFIX: temp-stack
steps:
- name: Destroy stack and ECR images
shell: bash
run: |
set -euo pipefail
repo_full="${GITHUB_REPOSITORY}"
owner_raw="${repo_full%%/*}"
repo_raw="${repo_full##*/}"
confirm="${{ github.event.inputs.confirm_destroy }}"
if [[ "$confirm" != "$repo_raw" ]]; then
echo "Refusing destroy: confirm_destroy must exactly match '$repo_raw'."
exit 1
fi
repo_slug="$(printf '%s' "$repo_raw" | tr '[:upper:]' '[:lower:]')"
stack_name="${APP_STACK_PREFIX}-${repo_slug}"
ecr_repo="temp/${repo_slug}"
aws cloudformation delete-stack --stack-name "$stack_name"
aws cloudformation wait stack-delete-complete --stack-name "$stack_name"
if aws ecr describe-repositories --repository-names "$ecr_repo" >/dev/null 2>&1; then
aws ecr delete-repository --repository-name "$ecr_repo" --force
fi