-
-
Notifications
You must be signed in to change notification settings - Fork 39
45 lines (38 loc) · 1.33 KB
/
dockerhub-publish.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
# This workflow will download the Maven Central package and
# build Docker image and publish to DockerHub
name: Publish to DockerHub
on:
workflow_dispatch:
inputs:
DB2REST_VERSION:
description: 'DB2REST version that is already published in Maven Central'
required: true
default: '1.3.0'
# release:
# types: [created]
jobs:
build_docker_image:
runs-on: ubuntu-latest
env:
DB2REST_VERSION: ${{ github.event.inputs.DB2REST_VERSION }}
permissions:
contents: read
packages: write
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# In this following step, we use our Dockerfile
# to build the image (which has a `ADD` line to automatically
# download the versioned JAR file from Central Portal and
# adds it into a layer of the image)
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
# We use default Git context to build the Docker image,
# instead of PATH context `context: .`
push: true
tags: kdhrubo/db2rest:v${{ github.run_number }}, kdhrubo/db2rest:latest
build-args: DB2REST_VERSION=${{ env.DB2REST_VERSION }}