Deploy to Digital Ocean Kubernetes #9
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 Digital Ocean Kubernetes | |
on: | |
workflow_run: | |
workflows: ["Build and Push Docker images"] | |
types: | |
- completed | |
branches: | |
- master | |
workflow_dispatch: | |
env: | |
DO_K8S_CLUSTER_NAME: "loadtesting-lon-01" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DO_TOKEN }} | |
- name: Save digitalocean kubeconfig | |
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ env.DO_K8S_CLUSTER_NAME }} | |
- name: Stop previous deployments | |
run: kubectl delete -f ./deployments/k8s || true | |
- name: Deploy to Digital Ocean Kubernetes | |
run: kubectl apply -f ./deployments/k8s |