-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (43 loc) · 1.43 KB
/
build-and-push.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
name: Build and Push
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set Image Tag
run: |
if [[ $GITHUB_REF_TYPE == 'tag' ]]; then
echo "TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
elif [[ $GITHUB_REF_NAME == 'main' ]]; then
echo "TAG=latest" >> $GITHUB_ENV
fi
- name: Set up JDK + Maven version
uses: s4u/setup-maven-action@v1.4.0
with:
java-version: '17'
maven-version: '3.8.6'
# Checkout trustyai-core
- name: Checkout external repository
uses: actions/checkout@v3
with:
repository: trustyai-explainability/trustyai-explainability
path: ./trustyai-explainability
ref: 'main'
# Maven build trustyai-core
- name: Maven Clean Install on External Repository
run: |
cd trustyai-explainability
mvn clean install -Pservice-minimal -DskipTests
- name: Build Docker image
run: docker build -f src/main/docker/Dockerfile.jvm -t ${{ vars.QUAY_RELEASE_REPO }}:$TAG .
- name: Log in to Quay
run: docker login -u ${{ secrets.QUAY_ROBOT_USERNAME }} -p ${{ secrets.QUAY_ROBOT_SECRET }} quay.io
- name: Push Docker image to Quay
run: docker push ${{ vars.QUAY_RELEASE_REPO }}:$TAG