Skip to content

Commit

Permalink
Merge pull request #15 from VatthanachaiW/develop
Browse files Browse the repository at this point in the history
Update config
  • Loading branch information
VatthanachaiW authored Feb 28, 2025
2 parents 5562f97 + 7c6d794 commit b61bd63
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ jobs:

- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }} .

- name: Tag Docker latest
run: docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }} ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:latest

- name: Push Docker image
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }}
run: |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/go-app:latest
- name: Get GKE Credentials
run: gcloud container clusters get-credentials "$CLUSTER_NAME" --region "$REGION" --project "$PROJECT_ID"

# - name: List Files and Directories
# run: find "$(pwd)" -type d

- name: Update Deployment
run: |
cd $GITHUB_WORKSPACE/k8s/overlays/prod
kustomize edit set image go-app=docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }}
# - name: Update Deployment
# run: |
# cd $GITHUB_WORKSPACE/k8s/overlays/prod
# kustomize edit set image go-app=docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/go-app:${{ github.sha }}

- name: Display Kustomization YAML
run: |
Expand Down
2 changes: 1 addition & 1 deletion k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: go-app
image: docker.io/vatthanachaiw/go-app
image: docker.io/vatthanachaiw/go-app:latest
resources:
limits:
memory: "256Mi"
Expand Down
5 changes: 0 additions & 5 deletions k8s/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ namespace: go-app-dev
resources:
- ../../base

images:
- name: go-app
newName: docker.io/vatthanachaiw/go-app
newTag: "gcr.io/$GITHUB_SHA"

patches:
- path: patch-deployment.yaml
- path: patch-configmap.yaml
5 changes: 0 additions & 5 deletions k8s/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ namespace: go-app-prod
resources:
- ../../base

images:
- name: go-app
newName: docker.io/vatthanachaiw/go-app
newTag: "gcr.io/$GITHUB_SHA"

patches:
- path: patch-deployment.yaml
- path: patch-configmap.yaml

0 comments on commit b61bd63

Please sign in to comment.