Skip to content

Commit

Permalink
ci: optimize update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
buehner committed Feb 20, 2025
1 parent 52e20cf commit 5ef3edf
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/update_base_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,15 @@ jobs:
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --tags

- name: List all tags
run: git tag

- name: Test main_tag
run: git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 | sed 's/^v//'

- name: Test next_tag
run: git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-next\.[0-9]+)?$' | sort -V | tail -n1 | sed 's/^v//'

- name: Get latest main tag
id: main_tag
run: echo "main_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 | sed 's/^v//')" >> $GITHUB_OUTPUT
run: echo "main_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 | sed 's/^v//')" | tee -a $GITHUB_OUTPUT

- name: Get latest next tag
id: next_tag
run: echo "next_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-next\.[0-9]+)?$' | sort -V | tail -n1 | sed 's/^v//')" >> $GITHUB_OUTPUT

- name: Show tags
run: cat $GITHUB_OUTPUT
run: echo "next_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-next\.[0-9]+)?$' | sort -V | tail -n1 | sed 's/^v//')" | tee -a $GITHUB_OUTPUT

update-docker-main:
update-main:
needs: latest-tags
uses: ./.github/workflows/release_docker.yml
with:
Expand All @@ -50,7 +35,7 @@ jobs:
nexus_user: ${{ secrets.NEXUS_USERNAME}}
nexus_pass: ${{ secrets.NEXUS_PASSWORD}}

update-docker-next:
update-next:
needs: latest-tags
uses: ./.github/workflows/release_docker.yml
with:
Expand Down

0 comments on commit 5ef3edf

Please sign in to comment.