diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6cfb696b..a5905a7c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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}"