Skip to content

Improved tests

Improved tests #353

name: Publish Docker image to Quay.io
on:
workflow_dispatch:
push:
paths-ignore:
- 'README.md'
- 'LICENSE.txt'
- 'deploy-to-openshift.sh'
- 'docker-compose.yaml'
- 'docs/**'
branches:
- 'main'
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
name: Build and publish Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'maven'
- name: Build
run: |
./mvnw -e -B -DskipTests=true clean package -Dnative
- name: Docker Login
uses: Azure/docker-login@v1
with:
# Container registry username
username: ${{ secrets.DOCKER_USERNAME }}
# Container registry password
password: ${{ secrets.DOCKER_PASSWORD }}
# Container registry server url
login-server: quay.io
- name: Build and push Docker images
run: |
IMAGE_TAG=$(git rev-parse --short=7 HEAD)
# IMAGE_TAG=v${{ github.run_number }}
docker build -f src/main/docker/Dockerfile.native -t quay.io/quarkus/registry-app:latest .
docker tag quay.io/quarkus/registry-app:latest quay.io/quarkus/registry-app:${IMAGE_TAG}
docker push quay.io/quarkus/registry-app:latest
docker push quay.io/quarkus/registry-app:${IMAGE_TAG}