Denys Vuika b67a73d832
[ACA-4649] release workflow fixes ()
* release workflow fixes

* fix release triggering on push to master

* cleanup
2023-03-07 06:06:34 -05:00

41 lines
1.2 KiB
YAML

name: "Publish Docker Images"
description: "Publish Docker image to quay.io or dockerhub or another domain - only publish the version on master - elsewhere version and branch"
inputs:
domain:
description: 'domain to publish image to'
required: true
type: string
username:
description: 'login username'
required: true
type: string
password:
description: 'login password'
required: true
type: string
branch_name:
description: 'Name of the branch the workflow runs on'
required: true
type: string
dry-run:
description: dry run flag
required: true
type: boolean
runs:
using: "composite"
steps:
- name: Get docker image tag name
shell: bash
run: |
if [[ "${{ inputs.branch_name }}" == "master" ]]; then
TAG_VERSION=$(jq -cr '.version' < package.json)
else
TAG_VERSION=${{ inputs.branch_name }}-${{ github.run_id }}
fi
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Publish image
shell: bash
run: ./scripts/travis/deploy/publish.sh "${{ inputs.domain }}" "$REPO_SLUG" "${{ inputs.username }}" "${{ inputs.password }}" "$TAG_VERSION" "${{ inputs.branch_name }}" "${{ inputs.dry-run }}"