Merge pull request #6 from ruivieira/parameters #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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 install trustyai-core | |
run: | | |
cd trustyai-explainability | |
mvn clean install -Pservice-minimal -DskipTests | |
# Maven build KServe explainer | |
- name: Maven install KServe explainer | |
run: mvn clean install package -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 |