This commit is contained in:
QuantumEntangledAndy committed 2023-04-18 08:55:15 +07:00
1 parent 45789d44d6
commit 1f37e699b2
4 files changed
+18 -10

No files matched your search

+13 -5
View File
@@ -139,7 +139,7 @@ jobs:
push_to_registry:
name: Build Docker image
if: startsWith(github.ref, 'refs/tags/') == false && github.event_name == 'push'
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- "cross"
@@ -183,11 +183,19 @@ jobs:
- name: Get tag name
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
id: tags
shell: bash
run: |
branch="$(echo "${GITHUB_REF#refs/heads/}" | sed -E 's|[/]|-|g')"
tags="${REPO_NAME}:${branch}"
if [ "${branch}" == "master" ]; then
tags="${tags},${REPO_NAME}:latest"
startsWith(github.ref, 'refs/tags/')
tags=""
if [[ "${GITHUB_REF}" =~ ^'refs/tags/'(.*) ]]; then
gittag="$(echo "${BASH_REMATCH[1]}" | sed -E 's|[/]|-|g')"
tags=""${REPO_NAME}:${gittag}"
elif [[ "${GITHUB_REF}" =~ ^'refs/heads/'(.*) ]]; then
branch="$(echo "${BASH_REMATCH[1]}" | sed -E 's|[/]|-|g')"
tags="${REPO_NAME}:${branch}"
if [ "${branch}" == "master" ]; then
tags="${tags},${REPO_NAME}:latest"
fi
fi
echo "TAGS=${tags}" >> $GITHUB_OUTPUT
env: