Skip to content

Docker Image CI

Docker Image CI #20

Workflow file for this run

name: Docker Image CI
on:
release:
types: [released, prereleased]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: ./fruit-producer
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/fruit-producer:${{ github.event.release.tag_name }}
${{ github.event.release.prerelease == false && 'ghcr.io/${{ github.repository_owner }}/fruit-producer:latest' }}
- name: build mvnm
run: |
cd fruit-consumer-java
mvn package
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: ./fruit-consumer-java
file: ./fruit-consumer-java/src/main/docker/Dockerfile.jvm
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/fruit-consumer-java:${{ github.event.release.tag_name }}
${{ github.event.release.prerelease == false && 'ghcr.io/${{ github.repository_owner }}/fruit-consumer-java:latest' }}