Skip to content
Open
24 changes: 10 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,31 @@ jobs:
build-test:
runs-on: ubuntu-latest
steps:
- run: echo "building and testing the app ..."
- run: echo "building and testing the app here..."

docker-build-push:
runs-on: ubuntu-latest
needs: build-test
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: WebApplication1/Dockerfile
push: true
tags: mabusaa/argocd-course-webapp:${{ github.sha }}
tags: sakshirathoree/argocd-course-webapp:${{ github.sha }}

promote-to-dev-environment:
runs-on: ubuntu-latest
needs: docker-build-push
Expand All @@ -56,4 +53,3 @@ jobs:
sed -i "s,tag:.*,tag:\ ${{ github.sha }}," helm/webapp/values.yaml
git add . && git commit -m "update image tag"
git push

4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build-test:
runs-on: ubuntu-latest
steps:
- run: echo "building and testing the app ..."
- run: echo "building and testing the app here again ..."
docker-build-push:
runs-on: ubuntu-latest
needs: build-test
Expand All @@ -36,7 +36,7 @@ jobs:
context: .
file: WebApplication1/Dockerfile
push: true
tags: mabusaa/argocd-course-webapp:${{ github.event.pull_request.head.sha }}
tags: sakshirathoree/argocd-course-webapp:${{ github.event.pull_request.head.sha }}
update-image-tag-in-helm:
runs-on: ubuntu-latest
needs: docker-build-push
Expand Down
5 changes: 4 additions & 1 deletion helm/webapp/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ spec:
ports:
- port: {{ .Values.service.port }}
targetPort: http
{{- if .Values.service.nodeport }}
nodePort: {{ .Values.service.nodeport }}
{{- end }}
protocol: TCP
name: http
selector:
{{- include "demo.selectorLabels" . | nindent 4 }}
{{- include "demo.selectorLabels" . | nindent 4 }}
7 changes: 4 additions & 3 deletions helm/webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
replicaCount: 1

image:
repository: mabusaa/argocd-course-webapp
repository: sakshirathoree/argocd-course-webapp
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "9dbc07045cd3502b9863803b21356cd5ec2a93eb"
tag: 4510b415d92e7ddb9271d2f2266010326fceb501

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -37,8 +37,9 @@ securityContext: {}
# runAsUser: 1000

service:
type: ClusterIP
type: NodePort
port: 80
nodeport: 32080

ingress:
enabled: false
Expand Down