edit deploy to kube

This commit is contained in:
areeqakbr 2025-02-17 16:32:40 +07:00
parent fadef5626b
commit ff36b182d1
1 changed files with 7 additions and 12 deletions

View File

@ -39,7 +39,7 @@ jobs:
git.winteraccess.id/winter-access/backend_nam:latest
deploy:
name: Deploy to Kubernetes Cluster
name: Deploy to kubernetes cluster
runs-on: ubuntu-latest
needs:
- build
@ -48,34 +48,29 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get short SHA
id: get-short-sha
run: |
id=$(echo ${{ github.sha }} | cut -c 1-7)
echo "id=$id" >> $GITHUB_ENV
echo "::set-output name=id::$id"
- name: Create Kubeconfig
run: |
mkdir -p $HOME/.kube
mkdir $HOME/.kube
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
- name: Setup Kubectl
uses: azure/setup-kubectl@v4
- name: Set the Kubernetes context
uses: azure/k8s-set-context@v2
with:
method: service-account
k8s-url: ${{ vars.KUBE_URL }}
k8s-secret: ${{ secrets.KUBE_SECRET }}
- name: Deploy to Kubernetes cluster
- name: Deploy to the Kubernetes cluster
uses: azure/k8s-deploy@v5
with:
action: deploy
namespace: nam-backend-dev
namespace: walanja-dev
manifests: |
deploy/kubernetes/dev.yaml
images: |
git.winteraccess.id/winter-access/backend_nam:dev-${{ env.id }}
git.winteraccess.id/winter-access/backend_nam:${{ steps.get-version.outputs.version }}-dev-${{ steps.get-short-sha.outputs.id }}