From e9cb4ab2b83d70c2e6a7b994974669a45d934f13 Mon Sep 17 00:00:00 2001 From: Gregory Hellings Date: Mon, 31 Jan 2022 00:38:23 -0600 Subject: [PATCH] Add automated k8s deployment --- .github/workflows/k8s.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index 26c3951..6ea33df 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -7,9 +7,6 @@ env: IMAGE_REGISTRY_USER: ${{ github.actor }} IMAGE_REGISTRY_PASSWORD: ${{ github.token }} - # 🖊️ EDIT to specify custom tags for the container image, or default tags will be generated below. - IMAGE_TAGS: "" - on: # https://docs.github.com/en/actions/reference/events-that-trigger-workflows push: @@ -52,3 +49,14 @@ jobs: registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} + + - name: Configure access to k8s + uses: azure/k8s-set-context@v2 + with: + method: kubeconfig + kubeconfig: ${{ secrets.KUBECONFIG }} + + - name: Update deployment to new image version + script: | + set -e -o pipefail + kubectl set image deployments/www www=${{ env.IMAGE_REGISTRY }}/${{ steps.build-image.outputs.image }}:${{ steps.time.outputs.time }}