-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release docker image workflow (#104)
* Add release docker image workflow * Choose dockerfile * Add build args * Add build args * Add build args
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Release Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
description: e.g. 0.1.0 | ||
dockerfile: | ||
required: true | ||
type: choice | ||
options: | ||
- Dockerfile.kubernetes | ||
- Dockerfile.privatecloud | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ inputs.version }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Get the date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
|
||
- name: Build and push k8s | ||
if: ${{ github.event.inputs.dockerfile == 'Dockerfile.kubernetes' }} | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: streamnative/apache-pulsar-grafana-dashboard-k8s:${{ inputs.version }} | ||
file: ${{ inputs.dockerfile }} | ||
build-args: | | ||
BUILD_DATE=${{ steps.date.outputs.date }} | ||
VCS_REF=v${{ inputs.version }} | ||
VERSION=${{ inputs.version }} | ||
- name: Build and push private | ||
if: ${{ github.event.inputs.dockerfile == 'Dockerfile.private' }} | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: streamnative/private-cloud-grafana:${{ inputs.version }} | ||
file: ${{ inputs.dockerfile }} | ||
build-args: | | ||
BUILD_DATE=${{ steps.date.outputs.date }} | ||
VCS_REF=v${{ inputs.version }} | ||
VERSION=${{ inputs.version }} |