1
0
mirror of https://github.com/mveril/qp-demo synced 2024-10-31 19:23:51 +01:00

Compare commits

...

6 Commits

2 changed files with 8 additions and 7 deletions

View File

@ -10,9 +10,6 @@ on:
- master
- release_*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
@ -36,7 +33,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
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