Skip to content

Commit

Permalink
Enhance GitHub Actions workflows: added jobs to fetch the latest beta…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
jaydrogers committed Jan 14, 2025
1 parent a7f0d4c commit a8b352b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/action_publish-images-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ on:
release:
types: [prereleased]
jobs:
get-latest-beta-release:
runs-on: ubuntu-24.04
outputs:
release_tag: ${{ steps.get_latest_beta.outputs.release_tag }}
steps:
- name: Get Latest Beta Release
id: get_latest_beta
run: |
LATEST_BETA=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases | jq -r '[.[] | select(.prerelease == true)][0].tag_name')
echo "release_tag=${LATEST_BETA}" >> $GITHUB_OUTPUT
build-beta-images:
uses: ./.github/workflows/service_docker-build-and-publish.yml
secrets: inherit
with:
release_type: 'beta'
ref: ${{ needs.get-latest-beta-release.outputs.release_tag }}
16 changes: 15 additions & 1 deletion .github/workflows/action_publish-images-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@ on:
workflow_dispatch:
release:
types: [released]
schedule:
- cron: '25 6 * * 1'

jobs:
get-latest-release:
runs-on: ubuntu-24.04
outputs:
release_tag: ${{ steps.get_latest_release.outputs.release_tag }}
steps:
- name: Get Latest Release
id: get_latest_release
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "release_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
build-production-images:
uses: ./.github/workflows/service_docker-build-and-publish.yml
secrets: inherit
with:
release_type: 'latest'
release_type: 'latest'
ref: ${{ needs.get-latest-release.outputs.release_tag }}
6 changes: 6 additions & 0 deletions .github/workflows/service_docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
required: true
description: 'Release type (latest, beta, edge, dev, etc)'
default: 'edge'
ref:
type: string
default: ${{ github.ref }}
description: 'The git ref to checkout (branch, tag, or commit SHA)'

jobs:

Expand All @@ -16,6 +20,8 @@ jobs:
steps:
- name: Check out code.
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Login to DockerHub
uses: docker/login-action@v3
Expand Down

0 comments on commit a8b352b

Please sign in to comment.