Build and push MTA-functions container image #2
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 MTA-functions container image | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'm2k/m2k-func/**' | |
env: | |
WORKDIR: m2k/m2k-func | |
MVN_OPTS: "" | |
jobs: | |
build-and-push-m2k-func: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build Java projects | |
run: | | |
cd ${WORKDIR} | |
cd move2kubeAPI | |
make install | |
cd .. | |
mvn ${MVN_OPTS} -B clean package -DskipTests | |
- name: Buildah Action | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
context: ${{ env.WORKDIR }} | |
image: serverless-workflow-m2k-kfunc | |
tags: latest ${{ github.sha }} | |
extra-args: --ulimit nofile=4096:4096 | |
containerfiles: | | |
${{ env.WORKDIR }}/src/main/docker/Dockerfile.jvm | |
- name: Push To quay.io | |
id: push-to-quay | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/orchestrator | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Print image url | |
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |