Skip to content

Publish Web-Tool Docker Image #2

Publish Web-Tool Docker Image

Publish Web-Tool Docker Image #2

name: Publish Web-Tool Docker Image
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version to build Docker image for (example 1.0.0)'
required: true
default: '1.x.x'
permissions:
contents: read
jobs:
docker:
runs-on: ubuntu-latest
if: github.actor == 'flexca'
steps:
- name: Checkout released tag
uses: actions/checkout@v4
with:
ref: refs/tags/v${{ github.event.inputs.releaseVersion }}
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build Web-Tool
run: mvn clean package -DskipTests
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./web-tool/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/enot-web-tool:${{ github.event.inputs.releaseVersion }}
${{ secrets.DOCKERHUB_USERNAME }}/enot-web-tool:latest