Created
April 30, 2021 16:57
-
-
Save alo9507/1d1538d3767d856162209cbca25a81a4 to your computer and use it in GitHub Desktop.
Use GitHub Actions and Kubeconfig to deploy to Kubernetes
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 Kubernetes | |
on: | |
push: | |
branches: [ development ] | |
pull_request: | |
branches: [ development ] | |
jobs: | |
deploy: | |
name: Deploy to Kubernetes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create kubeconfig | |
run: | | |
mkdir ${HOME}/.kube | |
echo ${{ secrets.KUBE_CONFIG }} | base64 --decode > ${HOME}/.kube/config | |
cat ${HOME}/.kube/config | |
- name: Use context | |
run: kubectl config use-context octobay-api | |
- name: Deploy to K8s | |
run: kubectl apply -f k8s/ |
nice! curious how come kubectl is installed on the machine?
ubuntu-latest is a custom docker image provided by github with a lot of tools to build apps like docker cli, kubectl, gcc , etc...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice! curious how come kubectl is installed on the machine?