Skip to content

Commit a8b352b

Browse files
committed
Enhance GitHub Actions workflows: added jobs to fetch the latest beta and production release tags, integrated scheduling for production releases, and introduced a new input parameter for specifying the git reference in the Docker build workflow. This update improves automation and ensures the correct versions are used during image builds.
1 parent a7f0d4c commit a8b352b

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.github/workflows/action_publish-images-beta.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ on:
55
release:
66
types: [prereleased]
77
jobs:
8+
get-latest-beta-release:
9+
runs-on: ubuntu-24.04
10+
outputs:
11+
release_tag: ${{ steps.get_latest_beta.outputs.release_tag }}
12+
steps:
13+
- name: Get Latest Beta Release
14+
id: get_latest_beta
15+
run: |
16+
LATEST_BETA=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases | jq -r '[.[] | select(.prerelease == true)][0].tag_name')
17+
echo "release_tag=${LATEST_BETA}" >> $GITHUB_OUTPUT
18+
819
build-beta-images:
920
uses: ./.github/workflows/service_docker-build-and-publish.yml
1021
secrets: inherit
1122
with:
1223
release_type: 'beta'
24+
ref: ${{ needs.get-latest-beta-release.outputs.release_tag }}

.github/workflows/action_publish-images-production.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@ on:
44
workflow_dispatch:
55
release:
66
types: [released]
7+
schedule:
8+
- cron: '25 6 * * 1'
79

810
jobs:
11+
get-latest-release:
12+
runs-on: ubuntu-24.04
13+
outputs:
14+
release_tag: ${{ steps.get_latest_release.outputs.release_tag }}
15+
steps:
16+
- name: Get Latest Release
17+
id: get_latest_release
18+
run: |
19+
LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
20+
echo "release_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
21+
922
build-production-images:
1023
uses: ./.github/workflows/service_docker-build-and-publish.yml
1124
secrets: inherit
1225
with:
13-
release_type: 'latest'
26+
release_type: 'latest'
27+
ref: ${{ needs.get-latest-release.outputs.release_tag }}

.github/workflows/service_docker-build-and-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
required: true
99
description: 'Release type (latest, beta, edge, dev, etc)'
1010
default: 'edge'
11+
ref:
12+
type: string
13+
default: ${{ github.ref }}
14+
description: 'The git ref to checkout (branch, tag, or commit SHA)'
1115

1216
jobs:
1317

@@ -16,6 +20,8 @@ jobs:
1620
steps:
1721
- name: Check out code.
1822
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.ref }}
1925

2026
- name: Login to DockerHub
2127
uses: docker/login-action@v3

0 commit comments

Comments
 (0)