Skip to content

Commit 9ac5039

Browse files
committed
Build docker image when a tag is pushed
1 parent 8ec0889 commit 9ac5039

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
name: build and push image to dockerhub
22
on:
33
push:
4-
branches:
5-
- ona-custom-changes
6-
workflow_dispatch:
7-
inputs:
8-
versionTag:
9-
description: "Version Tag"
10-
required: true
11-
default: ""
4+
tags:
5+
- '[0-9]+\.[0-9]+\.[0-9]+'
126
jobs:
137
main:
148
runs-on: ubuntu-22.04
159
steps:
10+
- name: Get the version
11+
id: get-version-release
12+
run: echo "version=${GITHUB_REF_NAME#refs/heads}" >> $GITHUB_ENV
13+
1614
- name: Checkout to version
1715
uses: actions/checkout@v3
1816
with:
19-
ref: ${{ github.event.inputs.versionTag || '0.0.4' }}
17+
ref: ${{ env.version }}
2018

2119
- name: Login to DockerHub
2220
uses: docker/login-action@v2
@@ -32,7 +30,7 @@ jobs:
3230
file: Dockerfile
3331
platforms: linux/amd64
3432
tags: |
35-
onaio/dirt-tile-server:${{ github.event.inputs.versionTag || '0.0.4' }}
33+
onaio/dirt-tile-server:${{ env.version }}
3634
3735
- name: Image digest
3836
run: echo ${{ steps.docker-build.outputs.digest }}

0 commit comments

Comments
 (0)