2023-03-14 17:01:56 -04: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/gh/docker-publish.sh "${{ inputs.domain }}" "$REPO_SLUG" "${{ inputs.username }}" "${{ inputs.password }}" "$TAG_VERSION" "${{ inputs.branch_name }}" "${{ inputs.dry-run }}"