From 491006431384d12943658e376b82fe48ccb9a263 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 20 Oct 2023 19:38:27 +0200 Subject: [PATCH] Only publish images to repo on tag, distinguish between latest and latest-lts --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e236f9..1bfeae2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,7 @@ jobs: build: runs-on: ubuntu-latest + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') steps: - uses: actions/checkout@master @@ -13,10 +14,10 @@ jobs: - name: Get version tag id: get_tag run: | - if [ ${{ startsWith(github.ref, 'refs/tags/') }} = true ]; then - echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT + if [ ${{ endsWith(github.ref, '-lts') }} = true ]; then + echo "tag=latest-lts,${GITHUB_REF:10}" >>$GITHUB_OUTPUT else - echo "tag=latest" >>$GITHUB_OUTPUT + echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT fi - name: Build and build uses: elgohr/Publish-Docker-Github-Action@2.12