chore: Dev to main #3922
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Docker and Optional Push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - demo | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| - demo | |
| types: | |
| - opened | |
| - ready_for_review | |
| - reopened | |
| - synchronize | |
| merge_group: | |
| workflow_dispatch: | |
| jobs: | |
| check-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_build: ${{ steps.filter.outputs.docker_related }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for relevant changes | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| docker_related: | |
| - 'code/**' | |
| - '!code/tests/**' | |
| - 'docker/**' | |
| - 'package.json' | |
| - 'pyproject.toml' | |
| - '.github/workflows/build-docker-images.yml' | |
| - '.github/workflows/build-docker.yml' | |
| - name: Skip - No Relevant Changes | |
| if: steps.filter.outputs.docker_related != 'true' && github.event_name != 'workflow_dispatch' | |
| run: echo "No relevant changes detected. Skipping docker build." | |
| docker-build: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.should_build == 'true' || github.event_name == 'workflow_dispatch' | |
| 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: | |
| new_registry: 'cwydcontainerreg.azurecr.io' | |
| new_username: 'cwydcontainerreg' | |
| app_name: ${{ matrix.app_name }} | |
| dockerfile: ${{ matrix.dockerfile }} | |
| push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo'|| github.ref_name == 'dependabotchanges' }} | |
| secrets: inherit |