Update docker-image.yml #5
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: '' | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 20.0.2 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '20.0.2' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B clean package | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./docker | |
push: false | |
tags: my-image-name:${{ github.run_number }} | |