1
0
mirror of https://github.com/mveril/qp-demo synced 2024-07-22 10:47:34 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
c499dfca52 Error if branch name is not correct 2021-06-14 20:27:19 +02:00
c70ff10919 Remove tag for build 2021-06-14 20:25:16 +02:00
5a403665c3 Fix build action 2021-06-14 20:25:16 +02:00
562ac3226a Fix branch name extraction 2021-06-14 20:25:08 +02:00
2 changed files with 9 additions and 5 deletions

View File

@ -36,7 +36,6 @@ jobs:
context: ./
file: ./Dockerfile
push: false
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/qp_demo:${{ GITHUB_REF#refs/heads/ }}.${{ GITHUB_SHA::8 }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -25,16 +25,21 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Get Docker tag from branch name
id: extract_docker_tag
shell: bash
run: |
if [ "${{ GITHUB_REF#refs/heads/ }}" == "master" ]; then
if [ "${{ steps.extract_branch.outputs.branch }}" == "master" ]; then
echo "##[set-output name=tag;]$(echo 'latest')"
elif [[ "${{ GITHUB_REF#refs/heads/ }}" == release_* ]]; then
echo "##[set-output name=tag;]$(echo '${{ GITHUB_REF#refs/heads/ }}' | cut -d '_' -f2-)"
elif [[ "${{ steps.extract_branch.outputs.branch }}" == release_* ]]; then
echo "##[set-output name=tag;]$(echo '${GITHUB_REF#refs/heads/}' | cut -d '_' -f2-)"
else
echo "##[set-output name=tag;]$(echo 'ghtest')"
exit 1
fi
- name: Login to Docker Hub