Init
This commit is contained in:
40
cleanup/action.yml
Normal file
40
cleanup/action.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Cleanup Preview
|
||||
description: Stop container and remove Pangolin resource
|
||||
|
||||
inputs:
|
||||
app-name:
|
||||
required: true
|
||||
description: Application name (used for image/container naming)
|
||||
slug:
|
||||
required: true
|
||||
description: Branch slug to clean up
|
||||
pangolin-api-url:
|
||||
required: true
|
||||
description: Base URL for the Pangolin API (https://api.pangolin.local)
|
||||
pangolin-api-key:
|
||||
required: true
|
||||
description: Pangolin API key
|
||||
pangolin-org-id:
|
||||
required: true
|
||||
description: Pangolin organization ID
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Remove Pangolin resource
|
||||
shell: bash
|
||||
env:
|
||||
PANGOLIN_API_URL: ${{ inputs.pangolin-api-url }}
|
||||
PANGOLIN_API_KEY: ${{ inputs.pangolin-api-key }}
|
||||
PANGOLIN_ORG_ID: ${{ inputs.pangolin-org-id }}
|
||||
run: |
|
||||
bash ${{ github.action_path }}/../scripts/pangolin-delete.sh \
|
||||
--resource-name "${{ inputs.app-name }}-${{ inputs.slug }}"
|
||||
|
||||
- name: Stop preview container
|
||||
shell: bash
|
||||
run: |
|
||||
CONTAINER="${{ inputs.app-name }}-${{ inputs.slug }}"
|
||||
docker stop "$CONTAINER" 2>/dev/null || true
|
||||
docker rm "$CONTAINER" 2>/dev/null || true
|
||||
docker rmi "${{ inputs.app-name }}:${{ inputs.slug }}" 2>/dev/null || true
|
||||
Reference in New Issue
Block a user