From 481131e700fa8c0e8148857233faaa1194fcec62 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 20 Oct 2023 19:32:32 +0200 Subject: [PATCH] Only publish images to repo on tag, distinguish between latest and latest-lts --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49fab1a..ce6053e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: build: needs: test runs-on: ubuntu-latest - if: github.event_name == 'push' + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') steps: - uses: actions/checkout@master @@ -46,10 +46,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: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5