name: "K8S Fission Deployment" on: workflow_dispatch: inputs: profile: description: "Profile to execute to" required: true type: choice options: [ DEV, TEST, STAGING ] jobs: destroy-fission: name: Destroy fission functions runs-on: ubuntu-latest env: RUNNER_TOOL_CACHE: /toolcache FISSION_PROFILE: ${{ github.event.inputs.profile }} FISSION_VER: 1.21.0 RAKE_VER: 0.1.3 steps: - name: ☸️ Setup kubectl uses: azure/setup-kubectl@v4 - name: ☘️ Configure Kubeconfig uses: azure/k8s-set-context@v4 with: method: kubeconfig kubeconfig: ${{ secrets[format('{0}_KUBECONFIG', github.event.inputs.profile)] }} - name: πŸ”„ Cache id: cache uses: actions/cache@v4 with: path: | /usr/local/bin/rake /usr/local/bin/fission key: ${{ runner.os }}-${{ github.event.repository.name }}-${{ hashFiles('.fission/deployment.json') }} - name: πŸ”„ Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | curl -L "https://${{ secrets.REGISTRY_PASSWORD }}@registry.vegastar.vn/vegacloud/make/releases/download/${RAKE_VER}/rake-${RAKE_VER}-x86_64-unknown-linux-musl.tar.gz" | tar xzv -C /tmp/ curl -L "https://github.com/fission/fission/releases/download/v${FISSION_VER}/fission-v${FISSION_VER}-linux-amd64" --output /tmp/fission install -o root -g root -m 0755 /tmp/rake-${RAKE_VER}-x86_64-unknown-linux-musl/rake /usr/local/bin/rake install -o root -g root -m 0755 /tmp/fission /usr/local/bin/fission fission check # rake cfg install fission -f - name: πŸ”Ž Checkout repository uses: actions/checkout@v4 - name: ♻️ Remove id: deploy run: | echo "use profile [$FISSION_PROFILE]" mkdir -p manifests || true rake sec detail && rake cfm detail && rake env detail && rake pkg detail && rake fn detail && rake ht detail rake sp build -fi && rake sp down -i - name: πŸ”” Send notification uses: appleboy/telegram-action@master if: always() with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} format: markdown socks5: ${{ secrets.TELEGRAM_PROXY_URL != '' && secrets.TELEGRAM_PROXY_URL || '' }} message: | ${{ steps.deploy.outcome == 'success' && '🟒 (=^ β—‘ ^=)' || 'πŸ”΄ (q‒́︿‒̀q)' }} Uninstall fn ${{ github.event.repository.name }} *Msg*: `${{ github.event.commits[0].message }}`