Skip to content

chose: update container-ci.yml #24

chose: update container-ci.yml

chose: update container-ci.yml #24

Workflow file for this run

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
service: ["Inventories", "Orchestrators", "Orders", "Payments", "Stocks"]
steps:
# Checkout the repository to access the code
- name: Check out the repository
uses: actions/checkout@v4
# Login to GitHub Container Registry to push Docker images
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Dynamically create the lowercase service name
- name: Set Service Lowercase
id: set_service_lowercase
run: |
service_lowercase=$(echo "${{ matrix.service }}" | tr '[:upper:]' '[:lower:]')
echo "service_lowercase=${service_lowercase}" >> $GITHUB_ENV
# Build and Push Docker Image
- name: Build and Push Image
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.service }}/${{ matrix.service }}.API/Dockerfile
push: true
tags: |
ghcr.io/${{ github.actor }}/${{ env.service_lowercase }}-api:latest