Skip to content

fix(configs): fix document service availability (#37) #20

fix(configs): fix document service availability (#37)

fix(configs): fix document service availability (#37) #20

Workflow file for this run

name: CD
on:
push:
branches: [main]
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
service: [client, eureka, api-gateway, hello-service, document-service]
include:
- service: client
context: ./client
dockerfile: ./client/Dockerfile
- service: eureka
context: ./server/eureka
dockerfile: ./server/eureka/Dockerfile
- service: api-gateway
context: ./server/api-gateway
dockerfile: ./server/api-gateway/Dockerfile
- service: hello-service
context: ./server/hello-service
dockerfile: ./server/hello-service/Dockerfile
- service: document-service
context: ./server/document-service
dockerfile: ./server/document-service/Dockerfile
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ env.REGISTRY }}/aet-devops25/team-sigma/${{ matrix.service }}:latest
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
runs-on: ubuntu-latest
needs: build-and-push
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up kubectl
uses: azure/setup-kubectl@v4
with:
version: "latest"
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: "latest"
- name: Configure kubectl
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
kubectl config current-context
- name: Deploy with Helm
run: |
helm upgrade team-sigma ./infra/helm/team-sigma \
--namespace nemo \
--wait \
--timeout=5m
- name: Verify deployment
run: |
kubectl get pods -n nemo
kubectl get services -n nemo
kubectl get ingress -n nemo