Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build & Push Images (main)

on:
push:
branches: [main]
workflow_dispatch:

env:
IMAGE_TAG: ${{ github.sha }}-${{ github.run_number }}

concurrency:
group: deploy-main
cancel-in-progress: true

jobs:
build_and_push:
runs-on: ubuntu-latest
environment: prod
strategy:
matrix:
include:
- name: product-service
context: example-1/backend/product_Service
- name: frontend
context: example-1/frontend

steps:
- uses: actions/checkout@v4

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

- name: ACR login
uses: azure/cli@v2
with:
inlineScript: az acr login --name ${{ vars.ACR_NAME }}

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Build & Push ${{ matrix.name }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
push: true
tags: ${{ vars.ACR_LOGIN_SERVER }}/${{ matrix.name }}:${{ env.IMAGE_TAG }}
20 changes: 20 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR CI (basic)

on:
pull_request:
branches: [ dev, main ]

permissions:
contents: read

jobs:
ci: # <-- Job ID is 'ci' to get the check name you need
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Tiny sanity step – replace with real unit tests later if you like
- name: Sanity check
run: |
echo "Repo: $GITHUB_REPOSITORY"
echo "PR: $GITHUB_HEAD_REF -> $GITHUB_BASE_REF"
13 changes: 13 additions & 0 deletions .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: reusable-ci (basic)

on:
workflow_call:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Sanity check
run: |
echo "✅ Reusable CI ran on $GITHUB_REF from $GITHUB_REPOSITORY"
2 changes: 1 addition & 1 deletion example-3/k8s/order-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: order-service-container
image: <AZURE_ACR>/order:latest
image: himanshudhakaw09acr10504.azurecr.io/backend-order:week09
imagePullPolicy: Always
ports:
- containerPort: 8001
Expand Down
2 changes: 1 addition & 1 deletion example-3/k8s/product-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: product-service-container
image: AZURE_CONTAINER_REGISTRY/product_service:latest
image: himanshudhakaw09acr10504.azurecr.io/backend-product:week09
imagePullPolicy: Always
ports:
- containerPort: 8000
Expand Down