Created
August 26, 2020 06:37
-
-
Save jketcham/41adeff363584667168b23450ff017b0 to your computer and use it in GitHub Desktop.
Deploy Kubernetes to DigitalOcean cluster with skaffold and kustomize on new tag pushes
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
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Build, push, and deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# In an ideal world, skaffold and kustomize would be in a github action (and we'd pin these binary versions) | |
- name: Install skaffold | |
run: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ | |
- name: Install kustomize | |
run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash && sudo mv kustomize /usr/local/bin | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Log in to DigitalOcean Container Registry with short-lived credentials | |
run: doctl registry login --expiry-seconds 600 | |
- name: Save DigitalOcean kubeconfig | |
run: doctl kubernetes cluster kubeconfig save {your-cluster-name} | |
- name: Deploy to cluster with Skaffold | |
run: skaffold run --profile prod --tag ${GITHUB_REF#refs/tags/} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment