Skip to content

Add Docker login

Add Docker login #2

Workflow file for this run

name: Build Kafka Test Apps
on:
push:
branches: [ "main" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: scholzj
DOCKER_TAG: latest
# strategy:
# fail-fast: false
# matrix:
# architecture: [ 'amd64', 'arm64' ]
steps:
# Checkout sources
- uses: actions/checkout@v3
# Install Java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
# Setup Maven cache
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Setup QEMU for multiplatform Docker builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# Setup Docker credentials
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# Build the Java project
- name: Build the Java project
run: make build
# Build the Container images
- name: Build and push the containers for amd64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: amd64
# with:
# architecture: ${{ matrix.language }}
- name: Build and push the containers for arm64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: arm64
# Push the container manifest
- name: Push the container manifest
run: make docker_push_manifest