Repository navigation
94 lines (88 loc) · 2.55 KB
/
Copy pathbuild-docker-images.yml
File metadata and controls
94 lines (88 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build Docker and Optional Push
on:
push:
branches:
- main
- dev
- demo
paths:
- 'src/**'
- 'docker/**'
- 'package.json'
- 'pyproject.toml'
- '.github/workflows/build-docker-images.yml'
- '.github/workflows/build-docker.yml'
pull_request:
branches:
- main
- dev
- demo
paths:
- 'src/**'
- 'docker/**'
- 'package.json'
- 'pyproject.toml'
- '.github/workflows/build-docker-images.yml'
- '.github/workflows/build-docker.yml'
types:
- opened
- ready_for_review
- reopened
- synchronize
merge_group:
workflow_dispatch:
permissions:
id-token: write
contents: read
packages: write
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.filter.outputs.docker_related }}
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- name: Check for relevant changes
id: filter
uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
with:
filters: |
docker_related:
- 'src/**'
- '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
strategy:
matrix:
include:
# Legacy entries required by branch protection (old check names)
- app_name: rag-adminwebapp
dockerfile: docker/Admin.Dockerfile
- app_name: rag-backend
dockerfile: docker/Backend.Dockerfile
- app_name: rag-webapp
dockerfile: docker/Frontend.Dockerfile
# Current entries
- app_name: rag-frontend
dockerfile: docker/Dockerfile.frontend
- app_name: rag-backend-v2
dockerfile: docker/Dockerfile.backend
- app_name: rag-functions
dockerfile: docker/Dockerfile.functions
uses: ./.github/workflows/build-docker.yml
with:
new_registry: 'cwydcontainerreg.azurecr.io'
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: false
secrets: inherit