-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (68 loc) · 1.84 KB
/
build.yml
File metadata and controls
74 lines (68 loc) · 1.84 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
name: Build and Push Docker Images
on:
push:
branches:
- main
paths:
- "client/**"
- "server/**"
- ".github/workflows/build.yml"
workflow_dispatch:
concurrency:
group: build-images-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
client: ${{ steps.filter.outputs.client }}
server: ${{ steps.filter.outputs.server }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changed paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
client:
- "client/**"
- ".github/workflows/build.yml"
server:
- "server/**"
- ".github/workflows/build.yml"
build-client:
needs: changes
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.client == 'true' }}
permissions:
contents: read
packages: write
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@main
with:
image-name: ls1intum/learn-hub/client
docker-file: client/Dockerfile
docker-context: ./client
tags: |
type=sha,format=short,prefix=main-
latest
secrets: inherit
build-server:
needs: changes
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.server == 'true' }}
permissions:
contents: read
packages: write
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@main
with:
image-name: ls1intum/learn-hub/server
docker-file: server/Dockerfile
docker-context: ./server
tags: |
type=sha,format=short,prefix=main-
latest
secrets: inherit