Skip to content

Deploy to Kubernetes #9

Deploy to Kubernetes

Deploy to Kubernetes #9

Workflow file for this run

name: Deploy to Kubernetes
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
required: true
default: 'production'
defaults:
run:
working-directory: ./kustomize
jobs:
deploy:
if: ${{ github.ref == 'refs/heads/master' && github.event.inputs.environment == 'production' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
- name: Login to Kubernetes
run: |
mkdir -p ~/.kube
echo "$KUBE_CONFIG" > ~/.kube/config
env:
KUBE_CONFIG: "${{secrets.KUBE_CONFIG}}"
- name: Deploy
run: |
./kustomize edit set image ghcr.io/twin-te/calendar-service:master=ghcr.io/twin-te/calendar-service:sha-${GITHUB_SHA::7}
./kustomize build . | kubectl apply -f -
kubectl rollout status deploy/calendar --timeout=3m