Skip to content

Add the correct validation services #9510

Add the correct validation services

Add the correct validation services #9510

name: Build and Publish CLI Image
on:
push:
release:
types:
- created
jobs:
docker-image-push:
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Prepare Branch Name
id: prepare_branch_name
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
# Replace slashes with hyphens in the branch name
echo "branch=$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Release Version
id: get_release_version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
VERSION=${{ github.event.release.tag_name }}
echo "::set-output name=version::$VERSION"
fi
- name: Prepare Docker Tags
id: prepare_docker_tags
shell: bash
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "::set-output name=tags::clinicalgenomics/cg-cli:${{ steps.get_release_version.outputs.version }},clinicalgenomics/cg-cli:latest"
else
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr "/" "-")
echo "::set-output name=tags::clinicalgenomics/cg-cli:$BRANCH_NAME"
fi
- name: Build and Push Docker Image
id: docker_cli_build
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile-cli
push: true
tags: ${{ steps.prepare_docker_tags.outputs.tags }}