From 3a359fc8f2e2b8c9cdff00528f438f62d344c101 Mon Sep 17 00:00:00 2001 From: brooke Date: Sat, 8 Mar 2025 18:51:17 -0500 Subject: [PATCH] update latest tag handling --- .forgejo/workflows/build.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index c0f1711..8dc9b4a 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -11,9 +11,11 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'true' - + - name: Install deps - run: curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && apt update && apt install -y jq + run: | + curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh + apt update && apt install -y jq - name: Set up Docker Buildx id: buildx @@ -29,16 +31,10 @@ jobs: - name: Get tags from GitLab repository id: get_tags run: | - TAGS=$("https://framagit.org/api/v4/projects/74246/repository/tags" | jq -r '.[].name') - echo "::set-output name=tags::$TAGS" - - - name: Filter out RC tags and get the latest version - id: filter_tags - run: | - TAGS="${{ steps.get_tags.outputs.tags }}" - FILTERED_TAGS=$(echo "$TAGS" | grep -Ev 'RC[0-9]$' | sort -V | tail -n 1) - echo "Latest tag excluding RC: $FILTERED_TAGS" - echo "::set-output name=latest_tag::$FILTERED_TAGS" + tags=$(curl -s https://framagit.org/api/v4/projects/74246/repository/tags) + latest_tag=$(echo $tags | jq -r '.[0].name') + echo "Latest tag: $latest_tag" + echo "::set-output name=latest_tag::$latest_tag" - name: Build and Push with Latest Tag uses: docker/build-push-action@v4 @@ -48,4 +44,4 @@ jobs: file: ./aktivisda/server/Dockerfile platforms: linux/amd64 push: true - tags: fung.uy/mirrors/aktivisda:${{ steps.filter_tags.outputs.latest_tag }} + tags: fung.uy/mirrors/aktivisda:${{ steps.get_tags.outputs.latest_tag }}