Feature/sonarqube #42
Workflow file for this run
This file contains hidden or 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 2 | |
| run: | | |
| TAG=$(git tag -l ${{ env.VERSION }}) | |
| if [ -n "$TAG" ] | |
| then | |
| echo "::error::This bio-api version tag ($TAG) already exists in repository." | |
| exit 1 | |
| fi | |
| version-check-docker: | |
| 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 multiomix 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/multiomix:${{ env.VERSION }} | |
| - name: evaluation result? | |
| run: | | |
| echo "Result of image check was: ${{ env.RESULT }}" | |
| env: | |
| RESULT: ${{ steps.is_image_exist.outputs.image_exist }} | |
| - name: multimomix current version docker image exists? | |
| if: steps.is_image_exist.outputs.image_exist == 1 | |
| uses: actions/github-script@v3 | |
| with: | |
| script: | | |
| core.setFailed('This multiomix version already exists on docker registry') | |