This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
83 lines (68 loc) · 2.17 KB
/
build-attribution.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: License Attribution
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '**'
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
# Setup Phase
- name: Setup node and install deps
uses: actions/setup-node@v3
with:
node-version: '16'
check-latest: true
- run: npm --prefix frontend ci --legacy-peer-deps
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
check-latest: true
cache: 'maven'
- name: Prepare docker tags for license image
id: preparetagslicense
uses: docker/metadata-action@v4
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
with:
images: ghcr.io/hyperledger-labs/business-partner-agent-license
tags: |
type=ref,event=tag
type=edge,branch=main
type=sha
# Build phase
- name: Build maven-license-plugin
run: mvn -f bin/license-maven-plugin/pom.xml clean editorconfig:format install -DskipITs=true -DskipTests=true
# Attribution Phase
- name: Frontend attribution
run: npm --prefix frontend run license
- name: Backend attribution
run: mvn -f backend/pom.xml compile -Pbackend-license
# Docker Phase (triggered only on main or tag)
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push license container
uses: docker/build-push-action@v4
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
with:
context: .
push: true
file: Dockerfile.license
tags: ${{ steps.preparetagslicense.outputs.tags }}