Skip to content

Build Docker Images #19

Build Docker Images

Build Docker Images #19

name: Build Docker Images
on:
workflow_run:
workflows: [Tests]
types: [completed]
branches:
- main
- dev
- demo
pull_request:
branches:
- main
- dev
- demo
types:
- opened
- ready_for_review
- reopened
- synchronize
merge_group:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: logging
run: echo "${{github.event.workflow_run.GITHUB_REF}}"
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Print branch name
run: echo "${{ steps.extract_branch.outputs.branch }}"
docker-build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
- app_name: rag-adminwebapp
dockerfile: docker/Admin.Dockerfile
- app_name: rag-backend
dockerfile: docker/Backend.Dockerfile
- app_name: rag-webapp
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'dev' || github.event.workflow_run.head_branch == 'demo' }}
secrets: inherit