Reputation: 396
I have a very specific use case leveraging github actions
Problem is, there are no ready yaml file actions on the Github market place for Linode integration- they have for other providers like AWS, Azure, GKE, etc using Dockerhub The internet in general does not have these use cases combined. I am a newbie to Github actions so it will take some time to hack this myself. Any help/pointers will be appreciated.
Upvotes: 2
Views: 847
Reputation: 396
After some hacking, I was able to come up with this simple workflow that works for me. Credit to this post
name: deployment-deploy
on:
push:
branches:
- somebranch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
#build and push image
- name: Build, tag, and push image to Private registry
id: build-image
env:
IMAGE_TAG: image_tag
run: |
docker build -t ${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG .
docker login registry.domain.com -u ${{ secrets.REGISTRY_USERNAME }} -p ${{secrets.REGISTRY_PASSWORD}}
docker push ${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG
echo "::set-output name=image::${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG"
- name: Kubernetes set context
uses: Azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBE_CONFIG }}
#push
- name: Deploy k8s yaml
id: deploy-k8s-yaml
run: |
# Verify deployment
kubectl rollout restart deployment some_depl
Upvotes: 2