Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
62e94f1
'jk'
s224877838 Sep 20, 2025
5ba4364
'jk'
s224877838 Sep 20, 2025
2a7cfe1
'kl'
s224877838 Sep 20, 2025
54754e0
'kl'
s224877838 Sep 20, 2025
3e65a79
'kl'
s224877838 Sep 20, 2025
fb24f8b
'kl'
s224877838 Sep 20, 2025
addf4d4
'kl'
s224877838 Sep 20, 2025
b4c1d86
Delete .github/workflows/backend_ci.yml
s224877838 Sep 20, 2025
c9e703b
Delete .github/workflows/frontend-cd.yml
s224877838 Sep 20, 2025
6b23e8c
Delete .github/workflows/frontend_ci.yml
s224877838 Sep 20, 2025
4743ffc
Create ci-cd.yml
s224877838 Sep 20, 2025
01e8a21
Update secrets.yaml
s224877838 Sep 20, 2025
c51aba2
Update docker-compose.yml
s224877838 Sep 20, 2025
44f98dc
Update backend-cd.yml
s224877838 Sep 20, 2025
1559c45
Update ci-cd.yml
s224877838 Sep 20, 2025
b1d3b0c
Update ci-cd.yml
s224877838 Sep 20, 2025
3298531
Delete .github/workflows/ci-cd.yml
s224877838 Sep 20, 2025
217155e
Create backend_ci.yml
s224877838 Sep 20, 2025
7fca6c3
Create frontend_ci.yml
s224877838 Sep 20, 2025
1777a67
Create frontend-cd.yml
s224877838 Sep 20, 2025
1f0bc11
Update backend-cd.yml
s224877838 Sep 22, 2025
42ce283
Delete .github/workflows/frontend-cd.yml
s224877838 Sep 22, 2025
590906c
Update backend_ci.yml
s224877838 Sep 22, 2025
0a42860
Delete .github/workflows/frontend_ci.yml
s224877838 Sep 22, 2025
c9c1f06
Update backend-cd.yml
s224877838 Sep 22, 2025
1ab5a66
Update backend_ci.yml
s224877838 Sep 22, 2025
b56394c
Rename backend-cd.yml to unified-cd.yml
s224877838 Sep 22, 2025
f814ee6
Update unified-cd.yml
s224877838 Sep 22, 2025
c049e9a
Rename backend_ci.yml to unified.yml
s224877838 Sep 22, 2025
f3d2f32
Rename unified.yml to unified-ci.yml
s224877838 Sep 22, 2025
173e72c
Update unified-ci.yml
s224877838 Sep 22, 2025
f30719b
'updated_unified-ci.yml'
s224877838 Sep 22, 2025
01c5835
Updated unified-ci.yml
s224877838 Sep 22, 2025
3efe3e1
updated unified-ci.yml
s224877838 Sep 22, 2025
8604cdc
Update unified-ci.yml
s224877838 Sep 22, 2025
6084a38
Update unified-ci.yml
s224877838 Sep 22, 2025
d2e0543
Update unified-ci.yml
s224877838 Sep 22, 2025
80851b8
Update unified-ci.yml
s224877838 Sep 22, 2025
4838917
Update unified-ci.yml
s224877838 Sep 22, 2025
e989627
Update unified-ci.yml
s224877838 Sep 22, 2025
e5794dd
Update unified-ci.yml
s224877838 Sep 29, 2025
7f41451
Delete .github/workflows/unified-cd.yml
s224877838 Sep 29, 2025
1e403a6
Update unified-ci.yml
s224877838 Sep 29, 2025
d384e7d
Update unified-ci.yml
s224877838 Sep 29, 2025
b690948
Update unified-ci.yml
s224877838 Sep 29, 2025
d494855
Update unified-ci.yml
s224877838 Sep 29, 2025
f777eb1
Update unified-ci.yml
s224877838 Sep 29, 2025
8333460
Update unified-ci.yml
s224877838 Sep 29, 2025
3eecc4e
Update unified-ci.yml
s224877838 Sep 29, 2025
2491c39
Update unified-ci.yml
s224877838 Sep 29, 2025
63e297d
Update unified-ci.yml
s224877838 Sep 29, 2025
f8bd48e
Update unified-ci.yml
s224877838 Sep 29, 2025
027214d
Update unified-ci.yml
s224877838 Sep 29, 2025
475f958
Update unified-ci.yml
s224877838 Sep 29, 2025
b01704d
Update unified-ci.yml
s224877838 Sep 29, 2025
00f23c8
Update unified-ci.yml
s224877838 Sep 29, 2025
ec6cd56
Update unified-ci.yml
s224877838 Sep 29, 2025
848eb2a
Update Dockerfile
s224877838 Sep 29, 2025
adce017
Update Dockerfile
s224877838 Sep 29, 2025
0cfa292
Create Dockerfile.test
s224877838 Sep 29, 2025
7a6dbc0
Update unified-ci.yml
s224877838 Sep 30, 2025
251d4bc
Update Dockerfile
s224877838 Sep 30, 2025
45ac5e0
Update Dockerfile
s224877838 Sep 30, 2025
047ccc2
Update Dockerfile
s224877838 Sep 30, 2025
9f2caff
Update Dockerfile
s224877838 Sep 30, 2025
cee0b0b
Update Dockerfile
s224877838 Sep 30, 2025
c93568b
Update unified-ci.yml
s224877838 Sep 30, 2025
51b038a
Update Dockerfile
s224877838 Sep 30, 2025
281b1da
Update Dockerfile
s224877838 Sep 30, 2025
e3d1f12
Update Dockerfile
s224877838 Sep 30, 2025
5d09cd9
Update unified-ci.yml
s224877838 Sep 30, 2025
5213fc4
Update unified-ci.yml
s224877838 Sep 30, 2025
ed05241
Update unified-ci.yml
s224877838 Sep 30, 2025
8929fb3
Update unified-ci.yml
s224877838 Sep 30, 2025
933626f
Update unified-ci.yml
s224877838 Sep 30, 2025
e8a4ace
Update unified-ci.yml
s224877838 Sep 30, 2025
5bfc122
Update unified-ci.yml
s224877838 Sep 30, 2025
cda4d56
Update unified-ci.yml
s224877838 Sep 30, 2025
c8e7511
Update and rename unified-ci.yml to unified-cd.yml
s224877838 Oct 4, 2025
eb63a39
Create unified-ci.yml
s224877838 Oct 4, 2025
98233c4
Update docker-compose.yml
s224877838 Oct 4, 2025
087f3cd
Update secrets.yaml
s224877838 Oct 4, 2025
09c1cbd
Create staging-deploy.yml
s224877838 Oct 4, 2025
af10386
Update unified-cd.yml
s224877838 Oct 4, 2025
b4fa874
Update unified-ci.yml
s224877838 Oct 4, 2025
0afef13
Update unified-ci.yml
s224877838 Oct 4, 2025
da8ed95
Update unified-ci.yml
s224877838 Oct 4, 2025
601a1d1
Update staging-deploy.yml
s224877838 Oct 4, 2025
1284ebb
Update staging-deploy.yml
s224877838 Oct 4, 2025
ef1c8db
Update staging-deploy.yml
s224877838 Oct 4, 2025
7183e68
Update staging-deploy.yml
s224877838 Oct 4, 2025
32606db
Update staging-deploy.yml
s224877838 Oct 4, 2025
64c57bb
Update unified-cd.yml
s224877838 Oct 4, 2025
a88a27c
Add files via upload
s224877838 Oct 4, 2025
41e0271
Update and rename unified-cd.yml to final-merged.yml
s224877838 Oct 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
101 changes: 0 additions & 101 deletions .github/workflows/backend-cd.yml

This file was deleted.

146 changes: 0 additions & 146 deletions .github/workflows/backend_ci.yml

This file was deleted.

148 changes: 148 additions & 0 deletions .github/workflows/final-merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# .github/workflows/unified-cd.yml
name: Final Merging to Production Environment

on:
workflow_dispatch:
inputs:
aks_cluster_name:
description: 'Name of the AKS Cluster'
required: true
default: 'myAKSCluster'
aks_resource_group:
description: 'Resource Group of the AKS Cluster'
required: true
default: 'deakinuni'
aks_acr_name:
description: 'Azure Container Registry name'
required: true
default: 'week8'
push:
branches:
- main

env:
ACR_LOGIN_SERVER: ${{ secrets.AZURE_CONTAINER_REGISTRY }}

jobs:

deploy_backend:
runs-on: ubuntu-latest
environment: Production

outputs:
PRODUCT_API_IP: ${{ steps.get_product_ip.outputs.external_ip }}
ORDER_API_IP: ${{ steps.get_order_ip.outputs.external_ip }}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Set AKS Context
run: |
az aks get-credentials \
--resource-group ${{ github.event.inputs.aks_resource_group }} \
--name ${{ github.event.inputs.aks_cluster_name }} \
--overwrite-existing

- name: Attach ACR
run: echo "Attached ACR"

- name: Deploy Backend Infra (ConfigMaps, Secrets, DBs)
run: |
cd k8s/
kubectl apply -f configmaps.yaml
kubectl apply -f secrets.yaml
kubectl apply -f product-db.yaml
kubectl apply -f order-db.yaml

- name: Deploy Backend Services (Product, Order)
run: |
cd k8s/
kubectl apply -f product-service.yaml
kubectl apply -f order-service.yaml

- name: Wait for Backend LoadBalancer IPs
run: |
echo "Waiting for Product & Order LoadBalancer IPs..."
for i in {1..60}; do
PRODUCT_IP=$(kubectl get service product-service-w08e1 -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
ORDER_IP=$(kubectl get service order-service-w08e1 -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
if [[ -n "$PRODUCT_IP" && -n "$ORDER_IP" ]]; then
echo "Product Service IP: $PRODUCT_IP"
echo "Order Service IP: $ORDER_IP"
echo "PRODUCT_IP=$PRODUCT_IP" >> $GITHUB_ENV
echo "ORDER_IP=$ORDER_IP" >> $GITHUB_ENV
break
fi
sleep 5
done
if [[ -z "$PRODUCT_IP" || -z "$ORDER_IP" ]]; then
echo "❌ Failed to get backend IPs"
exit 1
fi

- name: Capture Product IP
id: get_product_ip
run: echo "external_ip=${{ env.PRODUCT_IP }}" >> $GITHUB_OUTPUT

- name: Capture Order IP
id: get_order_ip
run: echo "external_ip=${{ env.ORDER_IP }}" >> $GITHUB_OUTPUT

- name: Logout Azure
if: always()
run: az logout

# ---------------- FRONTEND DEPLOYMENT ----------------
deploy_frontend:
runs-on: ubuntu-latest
environment: Production
needs: deploy_backend

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: ACR Login
uses: docker/login-action@v2
with:
registry: ${{ env.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Inject Backend IPs into Frontend
run: |
echo "Injecting Backend IPs into frontend/main.js"
sed -i "s|_PRODUCT_API_URL_|http://${{ needs.deploy_backend.outputs.PRODUCT_API_IP }}:8000|g" frontend/main.js
sed -i "s|_ORDER_API_URL_|http://${{ needs.deploy_backend.outputs.ORDER_API_IP }}:8001|g" frontend/main.js
cat frontend/main.js

- name: Build & Push Frontend Image
run: |
docker build -t ${{ env.ACR_LOGIN_SERVER }}/frontend:latest ./frontend/
docker push ${{ env.ACR_LOGIN_SERVER }}/frontend:latest

- name: Set AKS Context
uses: azure/aks-set-context@v3
with:
resource-group: ${{ github.event.inputs.aks_resource_group }}
cluster-name: ${{ github.event.inputs.aks_cluster_name }}

- name: Deploy Frontend
run: |
cd k8s/
kubectl apply -f frontend.yaml

- name: Logout Azure
if: always()
run: az logout
Loading