Docker Image CI #13
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: | |
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 |