update latest tag handling
This commit is contained in:
parent
347fbfa4bf
commit
3a359fc8f2
1 changed files with 9 additions and 13 deletions
|
@ -11,9 +11,11 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- name: Install deps
|
- 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
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
|
@ -29,16 +31,10 @@ jobs:
|
||||||
- name: Get tags from GitLab repository
|
- name: Get tags from GitLab repository
|
||||||
id: get_tags
|
id: get_tags
|
||||||
run: |
|
run: |
|
||||||
TAGS=$("https://framagit.org/api/v4/projects/74246/repository/tags" | jq -r '.[].name')
|
tags=$(curl -s https://framagit.org/api/v4/projects/74246/repository/tags)
|
||||||
echo "::set-output name=tags::$TAGS"
|
latest_tag=$(echo $tags | jq -r '.[0].name')
|
||||||
|
echo "Latest tag: $latest_tag"
|
||||||
- name: Filter out RC tags and get the latest version
|
echo "::set-output name=latest_tag::$latest_tag"
|
||||||
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"
|
|
||||||
|
|
||||||
- name: Build and Push with Latest Tag
|
- name: Build and Push with Latest Tag
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
@ -48,4 +44,4 @@ jobs:
|
||||||
file: ./aktivisda/server/Dockerfile
|
file: ./aktivisda/server/Dockerfile
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
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