Skip to content

Commit

Permalink
Add dockerhub build and push github action
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Dec 14, 2022
1 parent d4cc051 commit a2868e9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-image-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build and push image to dockerhub
on:
workflow_dispatch:
inputs:
versionTag:
description: "Version Tag"
required: true
default: ""
jobs:
main:
runs-on: ubuntu-22.04
steps:
- name: Checkout to version
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.versionTag }}

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

- name: Build and push
id: docker-build
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
platforms: linux/amd64
tags: |
onaio/dirt-tile-server:${{ github.event.inputs.versionTag }}
- name: Image digest
run: echo ${{ steps.docker-build.outputs.digest }}

0 comments on commit a2868e9

Please sign in to comment.