-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.72 KB
/
build-backend.yaml
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
name: Build (Backend)
on:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
apps: ${{ steps.filter.outputs.changes }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Filter changed paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
account/server:
- 'account/server/**'
auth/server:
- 'auth/server/**'
auth/server-session:
- 'auth/server-session/**'
notification/consumer-email:
- 'notification/consumer-email/**'
example/server:
- 'example/server/**'
build:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.apps != '' && toJson(fromJson(needs.changes.outputs.apps)) != '[]' }}
strategy:
matrix:
APP_DIR: ${{ fromJSON(needs.changes.outputs.apps) }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/noah-platform/noah/${{ matrix.APP_DIR }}:latest
build-args: |
APP_DIR=${{ matrix.APP_DIR }}
cache-from: type=gha
cache-to: type=gha,mode=max