diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 06ad92a..97d8335 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -45,4 +45,27 @@ jobs: # if: ${{ github.ref == 'refs/heads/dev' }} # with: # url: ${{ secrets.CONTAINER_WEBHOOK }} - # method: 'POST' \ No newline at end of file + # method: 'POST' + + deploy: + name: Deploy to Kubernetes cluster + runs-on: k8s-route + if: github.ref == 'refs/heads/dev' + steps: + - + name: Checkout source code + uses: actions/checkout@v3 + + - + name: Configure the Kubernetes context + uses: azure/k8s-set-context@v2 + with: + method: service-account + k8s-url: ${{ secrets.KUBERNETES_URL }} + k8s-secret: ${{ secrets.KUBERNETES_SECRET }} + + # TODO: looks very unsafe for meed, need review about migrate to GH Action "azure/k8s-deploy" + - + name: Deploy to the Kubernetes cluster + run: | + kubectl -n telegram-bot rollout restart deploy bot