55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
name: "Manual Uninstall"
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: 'Environment to uninstall from (dev, staging, prod)'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- dev
|
|
- staging
|
|
- prod
|
|
|
|
jobs:
|
|
uninstall:
|
|
name: Uninstall from ${{ github.event.inputs.environment }}
|
|
runs-on: ubuntu-latest
|
|
environment: ${{ github.event.inputs.environment }}
|
|
steps:
|
|
- name: ☸️ Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: ☸️ Setup kubectl
|
|
uses: azure/setup-kubectl@v4
|
|
with:
|
|
version: 'v1.28.0'
|
|
|
|
- name: 🔐 Configure Kubeconfig
|
|
uses: azure/k8s-set-context@v4
|
|
with:
|
|
method: kubeconfig
|
|
kubeconfig: ${{ secrets[format('KUBECONFIG_{0}', github.event.inputs.environment)] }}
|
|
|
|
- name: 🚀 Install Fission CLI
|
|
run: |
|
|
curl -L https://github.com/fission/fission/releases/latest/download/fission-linux-amd64 -o /tmp/fission
|
|
sudo install /tmp/fission /usr/local/bin/fission
|
|
fission check
|
|
|
|
- name: 🗑️ Uninstall functions
|
|
run: |
|
|
echo "Uninstalling from ${{ github.event.inputs.environment }} environment..."
|
|
# Delete all functions in this repository/package
|
|
# Note: This will remove functions defined in deployment.json
|
|
fission function list --all-namespaces | grep "${{ github.event.repository.name }}" | awk '{print $1}' | xargs -r fission function delete --name
|
|
|
|
- name: 🔔 Notify
|
|
if: always()
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const env = '${{ github.event.inputs.environment }}';
|
|
const status = '${{ job.status }}';
|
|
console.log(`Uninstall from ${env} completed with status: ${status}`);
|