Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check if version exist on docker registry | |
on: | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
version-check-repo: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get version | |
run: BASEDIR=$(pwd) ./tools/get_version.sh | |
- name: Set version | |
run: BASEDIR=$(pwd) ./tools/get_version.sh >> $GITHUB_ENV | |
- name: Check if tag exist | |
run: | | |
TAG=$(git tag -l ${{ env.VERSION }}) | |
if [ -n "$TAG" ] | |
then | |
echo "::error::This modulector version tag ($TAG) already exists in repository." | |
exit 1 | |
fi | |
version-check-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get version | |
run: BASEDIR=$(pwd) ./tools/get_version.sh | |
- name: Set version | |
run: BASEDIR=$(pwd) ./tools/get_version.sh >> $GITHUB_ENV | |
- name: Check modulector current version | |
id: is_image_exist | |
uses: tm-bverret/docker-exist-action@v1.1.2 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
image: omicsdatascience/modulector:${{ env.VERSION }} | |
- name: evaluation result? | |
run: | | |
echo "Result of image check was: ${{ env.RESULT }}" | |
env: | |
RESULT: ${{ steps.is_image_exist.outputs.image_exist }} | |
- name: modulector current version docker image exists? | |
if: steps.is_image_exist.outputs.image_exist == 1 | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('This modulector version already exists on docker registry') |