generated from finos-labs/project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 66
62 lines (59 loc) · 1.95 KB
/
build-and-publish.yml
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
name: Build and Publish Application Images
on:
workflow_dispatch:
push:
branches:
- main
env:
VERSION: 'latest'
CONTAINER_REGISTRY: 'ghcr.io/finos'
jobs:
build-ghcr:
name: Build and push application images to GHCR
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- directory: account-service/
image: traderx/account-service
- directory: database/
image: traderx/database
- directory: ingress/
image: traderx/ingress
- directory: people-service/
image: traderx/people-service
- directory: position-service/
image: traderx/position-service
- directory: reference-data/
image: traderx/reference-data
- directory: trade-feed/
image: traderx/trade-feed
- directory: trade-processor/
image: traderx/trade-processor
- directory: trade-service/
image: traderx/trade-service
- directory: web-front-end/angular/
image: traderx/web-front-end-angular
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ${{ matrix.image }}
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.directory }}
push: ${{ github.event_name == 'push' && true || false }}
tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}
- name: Scan for vulnerabilities in ${{ matrix.image }}
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}