From 85679584fabc2e88dd304d2728869139fb131cb2 Mon Sep 17 00:00:00 2001 From: Viswanadhsai Date: Thu, 3 Sep 2026 11:16:11 +1000 Subject: [PATCH 1/2] Trigger Week 08 CI CD pipeline --- user-service/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 user-service/README.md diff --git a/user-service/README.md b/user-service/README.md new file mode 100644 index 0000000..228710f --- /dev/null +++ b/user-service/README.md @@ -0,0 +1 @@ +# Week 08 CI/CD demonstration From 96151e4599d93cf3dfbae292924122ac873562bc Mon Sep 17 00:00:00 2001 From: Viswanadhsai Date: Thu, 10 Sep 2026 22:17:00 +1000 Subject: [PATCH 2/2] Implement automated continuous deployment for Task 9.3C --- .github/workflows/04-deploy-production.yml | 90 ++++++++-------------- frontend/src/pages/Dashboard.jsx | 2 +- 2 files changed, 31 insertions(+), 61 deletions(-) diff --git a/.github/workflows/04-deploy-production.yml b/.github/workflows/04-deploy-production.yml index 969d646..55fef77 100644 --- a/.github/workflows/04-deploy-production.yml +++ b/.github/workflows/04-deploy-production.yml @@ -1,24 +1,30 @@ name: 04 - Deploy to Production on: - workflow_dispatch: - inputs: - image_tag: - description: "Tested image SHA to deploy" - required: true - type: string + workflow_run: + workflows: + - "03 - Test Staging" + types: + - completed + branches: + - main jobs: deploy-production: name: Deploy to Production runs-on: ubuntu-latest + if: > + ${{ github.event.workflow_run.conclusion == 'success' }} + environment: name: production steps: - - name: Checkout repository + - name: Checkout tested commit uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_sha }} - name: Login to Azure uses: azure/login@v3 @@ -63,80 +69,44 @@ jobs: - name: Apply Kubernetes manifests run: | - kubectl apply \ - -f kubernetes/production/ + kubectl apply -f kubernetes/production/ - - name: Update frontend image + - name: Deploy tested images run: | + IMAGE_TAG="${{ github.event.workflow_run.head_sha }}" + kubectl set image deployment/frontend \ - frontend=${{ vars.ACR_LOGIN_SERVER }}/koalatech-frontend:${{ inputs.image_tag }} \ + frontend=${{ vars.ACR_LOGIN_SERVER }}/koalatech-frontend:$IMAGE_TAG \ -n production - - name: Update user-service image - run: | kubectl set image deployment/user-service \ - user-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-user-service:${{ inputs.image_tag }} \ + user-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-user-service:$IMAGE_TAG \ -n production - - name: Update student-service image - run: | kubectl set image deployment/student-service \ - student-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-student-service:${{ inputs.image_tag }} \ + student-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-student-service:$IMAGE_TAG \ -n production - - name: Update lecturer-service image - run: | kubectl set image deployment/lecturer-service \ - lecturer-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-lecturer-service:${{ inputs.image_tag }} \ + lecturer-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-lecturer-service:$IMAGE_TAG \ -n production - - name: Update course-service image - run: | kubectl set image deployment/course-service \ - course-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-course-service:${{ inputs.image_tag }} \ + course-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-course-service:$IMAGE_TAG \ -n production - - name: Update enrollment-service image - run: | kubectl set image deployment/enrollment-service \ - enrollment-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-enrollment-service:${{ inputs.image_tag }} \ + enrollment-service=${{ vars.ACR_LOGIN_SERVER }}/koalatech-enrollment-service:$IMAGE_TAG \ -n production - - name: Wait for frontend rollout - run: | - kubectl rollout status deployment/frontend \ - -n production \ - --timeout=300s - - - name: Wait for user-service rollout - run: | - kubectl rollout status deployment/user-service \ - -n production \ - --timeout=300s - - - name: Wait for student-service rollout - run: | - kubectl rollout status deployment/student-service \ - -n production \ - --timeout=300s - - - name: Wait for lecturer-service rollout - run: | - kubectl rollout status deployment/lecturer-service \ - -n production \ - --timeout=300s - - - name: Wait for course-service rollout - run: | - kubectl rollout status deployment/course-service \ - -n production \ - --timeout=300s - - - name: Wait for enrollment-service rollout + - name: Wait for production rollouts run: | - kubectl rollout status deployment/enrollment-service \ - -n production \ - --timeout=300s + kubectl rollout status deployment/frontend -n production --timeout=300s + kubectl rollout status deployment/user-service -n production --timeout=300s + kubectl rollout status deployment/student-service -n production --timeout=300s + kubectl rollout status deployment/lecturer-service -n production --timeout=300s + kubectl rollout status deployment/course-service -n production --timeout=300s + kubectl rollout status deployment/enrollment-service -n production --timeout=300s - name: Show production resources run: | diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index c42604a..9456971 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -199,7 +199,7 @@ const Dashboard = () => { - Welcome to KoalaTech University + S226051707 | KoalaTech Live Deployment