Skip to content

Commit

Permalink
update cicd to redeploy backend
Browse files Browse the repository at this point in the history
  • Loading branch information
louisheal committed Jan 7, 2025
1 parent 08ed912 commit 0a3eb40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Build Docker image
run: |
docker build -t ljheal/streampets-backend:latest .
docker build -t ljheal/streampets-backend:${{ github.sha }} .
- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -24,8 +24,12 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker image to Docker Hub
run: |
docker push ljheal/streampets-backend:latest
uses: docker/build-push-action@v3
with:
push: true
tags: |
ljheal/streampets-backend:latest
ljheal/streampets-backend:${{ github.sha }}
deploy:
needs: build
Expand All @@ -50,3 +54,7 @@ jobs:
kubectl apply -f .k8s/deployment.yaml
kubectl apply -f .k8s/service.yaml
kubectl apply -f .k8s/ingress.yaml
kubectl set image deployment/streampets-backend \
streampets-backend-container=docker.io/ljheal/streampets-backend:${{ github.sha }} \
-n streampets
2 changes: 1 addition & 1 deletion .k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: streampets-backend-container
image: ljheal/streampets-backend:latest
image: ljheal/streampets-backend
envFrom:
- secretRef:
name: backend-env
Expand Down

0 comments on commit 0a3eb40

Please sign in to comment.