Skip to content

Commit

Permalink
Merge pull request #27 from docknetwork/ci/docker-hub-build
Browse files Browse the repository at this point in the history
added Github build action for Docker Hub
  • Loading branch information
cykoder authored Feb 20, 2023
2 parents 85b619a + bbb1988 commit dab7b4e
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker_hub_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker Container Build

on:
workflow_dispatch:
inputs:
image_tag:
type: string
description: The tag to apply to the built container image
required: true
default: latest

release:
types:
- published
branches:
- master

jobs:
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set tag name
id: image_tag
shell: bash
run: |
export TAG_NAME=docknetwork/dock-did-driver:build-${{github.run_number}}
if [ "${{ github.event.inputs.image_tag}}" != "" ];
then
export TAG_NAME=docknetwork/dock-did-driver:${{github.event.inputs.image_tag}}
fi
if [ "${{ github.event_name}}" == "release" ];
then
export TAG_NAME='docknetwork/dock-did-driver:latest'
fi
echo "Trigger: ${{github.event_name}} TAG_NAME: $TAG_NAME"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
- name: 'Build production ${{ steps.image_tag.outputs.TAG_NAME }} image'
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.image_tag.outputs.TAG_NAME }}

0 comments on commit dab7b4e

Please sign in to comment.