From 9b4a371a6a025e076b3a56aec844b88ba759b6b1 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Sun, 8 Sep 2024 22:22:50 +1000 Subject: [PATCH] Update workflow --- .github/workflows/build-and-deploy.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index dd716a0..47940b0 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -41,17 +41,13 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: Set up kubectl + - name: Deploy to Kubernetes uses: wahyd4/kubectl-helm-action@master env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - - - name: Deploy to Kubernetes - run: | - # Update the deployment.yaml with the new image tag - sed -i 's|image: .*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}|' k8s/deployment.yaml - - # Apply Kubernetes manifests - kubectl apply -n apps -f k8s/deployment.yaml - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + with: + args: |- + # Update the deployment.yaml with the new image tag + sed -i 's|image: .*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}|' k8s/deployment.yaml + # Apply Kubernetes manifests + kubectl apply -n apps -f k8s/deployment.yaml