From 4127522d7a30cdbe8baa94eff15d1fd2526582ba Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Thu, 17 Sep 2026 16:49:49 +1000 Subject: [PATCH 1/9] Trigger Week 8 continuous delivery pipeline --- user-service/app/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user-service/app/main.py b/user-service/app/main.py index 1b4769a6..c98ba508 100644 --- a/user-service/app/main.py +++ b/user-service/app/main.py @@ -1,3 +1,4 @@ +# Week 8 continuous delivery pipeline test import logging import os import time @@ -138,4 +139,4 @@ def health_check() -> dict[str, str]: return { "status": "healthy", "service": "user-service", - } \ No newline at end of file + } From 3a7d5ef2162f2ef298f5c70b79154788e883c170 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Thu, 17 Sep 2026 16:53:29 +1000 Subject: [PATCH 2/9] Enable Week 8 CI pipeline test --- user-service/app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user-service/app/main.py b/user-service/app/main.py index c98ba508..a33084d1 100644 --- a/user-service/app/main.py +++ b/user-service/app/main.py @@ -1,4 +1,4 @@ -# Week 8 continuous delivery pipeline test +# Week 8 continuous delivery pipeline test enabled import logging import os import time From 8cc45e98cad562e3a144ddd03526306943648520 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 12:30:13 +1000 Subject: [PATCH 3/9] Add automated CD pipeline for Task 9.3C --- .github/workflows/01-ci.yml | 13 +++++----- .github/workflows/02-deploy-staging.yml | 5 ++-- .github/workflows/04-deploy-production.yml | 29 ++++++++++++++++------ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/01-ci.yml b/.github/workflows/01-ci.yml index 8206db43..531caf99 100644 --- a/.github/workflows/01-ci.yml +++ b/.github/workflows/01-ci.yml @@ -1,13 +1,14 @@ -name: 01 - CI - on: - # Trigger the workflow on push to main branch + pull_request: + branches: + - main + push: branches: - main - - # Manual trigger for the workflow - workflow_dispatch: + + workflow_dispatchname: 01 - CI + jobs: diff --git a/.github/workflows/02-deploy-staging.yml b/.github/workflows/02-deploy-staging.yml index 006bb70d..5324da9f 100644 --- a/.github/workflows/02-deploy-staging.yml +++ b/.github/workflows/02-deploy-staging.yml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest if: > - ${{ github.event.workflow_run.conclusion == 'success' }} + ${{ github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' }} environment: name: staging @@ -148,4 +149,4 @@ jobs: run: | kubectl get pods -n staging kubectl get services -n staging - kubectl get pvc -n staging \ No newline at end of file + kubectl get pvc -n staging diff --git a/.github/workflows/04-deploy-production.yml b/.github/workflows/04-deploy-production.yml index 969d646b..af397e49 100644 --- a/.github/workflows/04-deploy-production.yml +++ b/.github/workflows/04-deploy-production.yml @@ -1,18 +1,31 @@ name: 04 - Deploy to Production on: + workflow_run: + workflows: + - "03 - Test Staging" + types: + - completed + branches: + - main + workflow_dispatch: inputs: image_tag: description: "Tested image SHA to deploy" required: true type: string - jobs: deploy-production: name: Deploy to Production runs-on: ubuntu-latest + if: > + ${{ (github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success') || + github.event_name == 'workflow_dispatch' }} + env: + IMAGE_TAG: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || inputs.image_tag }} environment: name: production @@ -69,37 +82,37 @@ jobs: - name: Update frontend image run: | kubectl set image deployment/frontend \ - frontend=${{ vars.ACR_LOGIN_SERVER }}/koalatech-frontend:${{ inputs.image_tag }} \ + frontend=${{ vars.ACR_LOGIN_SERVER }}/koalatech-frontend:${{ env.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:${{ env.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:${{ env.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:${{ env.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:${{ env.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:${{ env.IMAGE_TAG }} \ -n production - name: Wait for frontend rollout @@ -142,4 +155,4 @@ jobs: run: | kubectl get pods -n production kubectl get services -n production - kubectl get pvc -n production \ No newline at end of file + kubectl get pvc -n production From 0d96cb0daf7b0b825d8385c9120e7fccb75bf3c3 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 12:55:15 +1000 Subject: [PATCH 4/9] Fix CI workflow YAML syntax --- .github/workflows/01-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/01-ci.yml b/.github/workflows/01-ci.yml index 531caf99..efc6dbe9 100644 --- a/.github/workflows/01-ci.yml +++ b/.github/workflows/01-ci.yml @@ -1,3 +1,5 @@ +name: 01 - CI + on: pull_request: branches: @@ -7,8 +9,9 @@ on: branches: - main - workflow_dispatchname: 01 - CI + workflow_dispatch: +jobs: jobs: From f639d48b47c7f6a0dee07088a45cc3f6fd003051 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 12:56:36 +1000 Subject: [PATCH 5/9] Fix CI workflow structure --- .github/workflows/01-ci.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/01-ci.yml b/.github/workflows/01-ci.yml index efc6dbe9..7f2fc702 100644 --- a/.github/workflows/01-ci.yml +++ b/.github/workflows/01-ci.yml @@ -12,20 +12,12 @@ on: workflow_dispatch: jobs: - - -jobs: - - # ========================================================= - # Backend Tests - # ========================================================= backend-test: name: Test ${{ matrix.service }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: include: - service: user-service @@ -72,20 +64,16 @@ jobs: POSTGRES_DB: ${{ matrix.database }} POSTGRES_HOST: localhost POSTGRES_PORT: ${{ matrix.port }} - JWT_SECRET_KEY: koalatech-ci-test-secret JWT_ALGORITHM: HS256 ACCESS_TOKEN_EXPIRE_MINUTES: 30 - DEFAULT_ADMIN_USERNAME: admin DEFAULT_ADMIN_EMAIL: admin@koalatech.edu.au DEFAULT_ADMIN_PASSWORD: AdminPassword123! - AZURE_STORAGE_CONNECTION_STRING: "" AZURE_STORAGE_CONTAINER_NAME: "" steps: - - name: Checkout repository uses: actions/checkout@v4 @@ -106,23 +94,17 @@ jobs: pytest -v - # ========================================================= - # Build and Push Docker Images - # ========================================================= build-and-push: name: Build and Push ${{ matrix.image }} runs-on: ubuntu-latest - # All backend tests must pass before this job starts needs: - backend-test - # Build and push when code is pushed to main or manually triggered if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false - matrix: include: - service: frontend @@ -144,7 +126,6 @@ jobs: image: koalatech-enrollment-service steps: - - name: Checkout repository uses: actions/checkout@v4 From 5632fc7dcafeee773c0fa701e0fce509ae901d4c Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 13:34:21 +1000 Subject: [PATCH 6/9] Automate production deployment after staging test --- .github/workflows/04-deploy-production.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/04-deploy-production.yml b/.github/workflows/04-deploy-production.yml index af397e49..d62cba9c 100644 --- a/.github/workflows/04-deploy-production.yml +++ b/.github/workflows/04-deploy-production.yml @@ -1,5 +1,3 @@ -name: 04 - Deploy to Production - on: workflow_run: workflows: From ccb83b5307a78bb3a6e655047f410373b68f4cc7 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 13:37:52 +1000 Subject: [PATCH 7/9] Fix staging workflow condition --- .github/workflows/02-deploy-staging.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/02-deploy-staging.yml b/.github/workflows/02-deploy-staging.yml index 5324da9f..6224fc0b 100644 --- a/.github/workflows/02-deploy-staging.yml +++ b/.github/workflows/02-deploy-staging.yml @@ -14,9 +14,7 @@ jobs: name: Deploy to Staging runs-on: ubuntu-latest - if: > - ${{ github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.event == 'push' }} + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }} environment: name: staging From a09d405f488946260d41b1b1a83c7045203943a9 Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Tue, 22 Sep 2026 13:41:28 +1000 Subject: [PATCH 8/9] Fix staging deployment workflow syntax --- .github/workflows/02-deploy-staging.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/02-deploy-staging.yml b/.github/workflows/02-deploy-staging.yml index 6224fc0b..fde2a3c1 100644 --- a/.github/workflows/02-deploy-staging.yml +++ b/.github/workflows/02-deploy-staging.yml @@ -14,8 +14,7 @@ jobs: name: Deploy to Staging runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }} - + if: ${{ github.event.workflow_run.conclusion == 'success' }} environment: name: staging From 5ee08ac6611802cc18c5f8399b3ce6301728c4bd Mon Sep 17 00:00:00 2001 From: Tharun-deakin Date: Thu, 1 Oct 2026 22:19:17 +1000 Subject: [PATCH 9/9] Enable automatic production deployment --- .github/workflows/04-deploy-production.yml | 3 ++- frontend/src/pages/Dashboard.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/04-deploy-production.yml b/.github/workflows/04-deploy-production.yml index d62cba9c..f91c4098 100644 --- a/.github/workflows/04-deploy-production.yml +++ b/.github/workflows/04-deploy-production.yml @@ -30,7 +30,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - + with: + ref: ${{ env.IMAGE_TAG }} - name: Login to Azure uses: azure/login@v3 with: diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index c42604a5..3da4cfcd 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -199,7 +199,7 @@ const Dashboard = () => { - Welcome to KoalaTech University + Welcome to KoalaTech University - Continuous Deployment