Skip to content

Docker Image CI

Docker Image CI #13

Workflow file for this run

name: Docker Image CI
on:
push:
paths:
- 'release-version'
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set the value
run: |
echo "version=$(cat release-version)" >> $GITHUB_ENV
- name: Login to Docker Hub
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
env:
DOCKER_BUILDKIT: 1
OPENJDK_VERSION: 20-slim
run: |
docker build . --file Dockerfile \
--tag $DOCKER_USER/hibiscus-server:${{ env.version }}-$OPENJDK_VERSION \
--tag $DOCKER_USER/hibiscus-server:${{ env.version }} \
--tag $DOCKER_USER/hibiscus-server:latest \
--build-arg HIBISCUS_VERSION=${{ env.version }} \
--build-arg OPENJDK_VERSION=$OPENJDK_VERSION
- name: Docker Push
run: docker push $DOCKER_USER/hibiscus-server --all-tags