-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (38 loc) · 1.12 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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