Skip to content

Commit

Permalink
Add custom image tags in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-ebram authored Oct 23, 2020
1 parent b71af16 commit b975139
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches: [ development, staging ]
release:
types: [ "published" ]
workflow_dispatch:
inputs:
tagName:
description: 'Tag of the image you want to build and push'
required: true

jobs:
build:
Expand All @@ -19,7 +24,10 @@ jobs:
run: |
DOCKER_IMAGE=cmusei/caster-ui
VERSION=development
if [[ $GITHUB_REF == refs/tags/* ]]; then
if [[ ! -z "${{ github.event.inputs.tagName }}" ]]; then
VERSION=${{ github.event.inputs.tagName }}
TAGS="${DOCKER_IMAGE}:${VERSION}"
elif [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
MAJORMINORVERSION=$(echo $VERSION | grep -oP '(\d+)\.(\d+)')
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${MAJORMINORVERSION}"
Expand Down

0 comments on commit b975139

Please sign in to comment.