mirror of
https://github.com/mveril/qp-demo
synced 2024-08-24 21:41:47 +02:00
First optimization
This commit is contained in:
parent
60fccd1850
commit
69fbc4474a
28
.github/workflows/docker-pull.yml
vendored
28
.github/workflows/docker-pull.yml
vendored
@ -26,6 +26,18 @@ jobs:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get Docker tag from branch name
|
||||
id: extract_docker_tag
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${GITHUB_REF#refs/heads/}" == "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-)"
|
||||
else
|
||||
echo "##[set-output name=tag;]$(echo 'ghtest')"
|
||||
fi
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
@ -36,22 +48,6 @@ jobs:
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- 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 [ "${{ steps.extract_branch.outputs.branch }}" == "master" ]; then
|
||||
echo "##[set-output name=tag;]$(echo 'latest')"
|
||||
elif [[ "${{ steps.extract_branch.outputs.branch }}" == release_* ]]; then
|
||||
echo "##[set-output name=tag;]$(echo '${{ steps.extract_branch.outputs.branch }}' | cut -d '_' -f2-)"
|
||||
else
|
||||
echo "##[set-output name=tag;]$(echo 'ghtest')"
|
||||
fi
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
|
Loading…
Reference in New Issue
Block a user