-
Notifications
You must be signed in to change notification settings - Fork 627
90 lines (84 loc) · 2.41 KB
/
build-docker-images.yml
File metadata and controls
90 lines (84 loc) · 2.41 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
name: Build Docker and Optional Push
on:
push:
branches:
- main
- dev
- demo
paths:
- 'code/**'
- '!code/tests/**'
- 'docker/**'
- 'package.json'
- 'pyproject.toml'
- '.github/workflows/build-docker-images.yml'
- '.github/workflows/build-docker.yml'
pull_request:
branches:
- main
- dev
- demo
paths:
- 'code/**'
- '!code/tests/**'
- '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@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'
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