From 65b0a03f97531e0ee01bd957714f5db04b6e1ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=A4derach?= Date: Tue, 22 Mar 2022 12:27:52 +0100 Subject: [PATCH] feat(docker): use github.ref_name variable for image name --- .github/workflows/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec7dfa4c..342a90d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ on: push: branches: - master + workflow_dispatch: jobs: @@ -14,16 +15,16 @@ jobs: uses: actions/checkout@v2 - name: Build PostgreSQL container image - run: | + run: | docker build --build-arg DATABASE_TYPE=postgresql \ - --tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7) \ + --tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-${github.ref_name} \ --tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest \ . - name: Build MySQL container image run: | docker build --build-arg DATABASE_TYPE=mysql \ - --tag ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7) \ + --tag ghcr.io/$GITHUB_ACTOR/umami:mysql-${github.ref_name} \ --tag ghcr.io/$GITHUB_ACTOR/umami:mysql-latest \ . @@ -36,7 +37,7 @@ jobs: run: | # Push each image individually, avoiding pushing to umami:latest # as MySQL or PostgreSQL are required - docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7) + docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-${github.ref_name} docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest - docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7) + docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-${github.ref_name} docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-latest