Deploy to k8s #1447
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to k8s | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Image Tag" | |
required: false | |
type: string | |
workflow_run: | |
workflows: | |
- Build & Publish images | |
types: | |
- completed | |
env: | |
DF_IMG_TAG: ${{ inputs.tag || github.sha }} | |
jobs: | |
build: | |
runs-on: ['self-hosted'] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Helm installer | |
uses: Azure/setup-helm@v3 | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Save DigitalOcean kubeconfig with short-lived credentials | |
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 k8s-cicd-pipeline-tm | |
- name: Install router | |
run: | | |
helm upgrade --install router $GITHUB_WORKSPACE/deployment-scripts/helm-charts/deepfence-router | |
- name: Clean up console | |
continue-on-error: true | |
run: | | |
helm delete console | |
- name: Install console | |
run: | | |
helm upgrade --wait --install console $GITHUB_WORKSPACE/deployment-scripts/helm-charts/deepfence-console --set global.imageTag=${DF_IMG_TAG} |