update latest tag handling
This commit is contained in:
parent
347fbfa4bf
commit
3a359fc8f2
1 changed files with 9 additions and 13 deletions
|
@ -13,7 +13,9 @@ jobs:
|
|||
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 }}
|
||||
|
|
Loading…
Add table
Reference in a new issue