Skip to content

Commit

Permalink
Added step for specific checkout of Git Ref for scheduled tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydrogers committed Jan 14, 2025
1 parent 5bf316a commit c06e9fe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/action_publish-images-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@ on:
- cron: '25 8 * * 1'

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:
needs: get-latest-beta-release
uses: ./.github/workflows/service_docker-build-and-publish.yml
with:
registry-repositories: "docker.io/serversideup/php,ghcr.io/serversideup/php"
tag-prefix: "beta"
release-type: "testing"
ref: ${{ needs.get-latest-beta-release.outputs.release_tag }}
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/action_publish-images-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@ on:
- cron: '0 8 * * 2'

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:
needs: get-latest-release
uses: ./.github/workflows/service_docker-build-and-publish.yml
with:
registry-repositories: "docker.io/serversideup/php,ghcr.io/serversideup/php"
tag-prefix: ''
release-type: "latest"
ref: ${{ needs.get-latest-release.outputs.release_tag }}
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/service_docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
type: boolean
default: true
description: 'Whether to push the images to the registry.'
ref:
type: string
default: ${{ github.ref }}
description: 'The git ref to checkout (branch, tag, or commit SHA)'

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

- name: Prepare PHP versions for the matrix. 😎
run: |
Expand Down Expand Up @@ -84,6 +90,8 @@ jobs:
steps:
- name: Check out code.
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Download PHP Versions file
uses: actions/download-artifact@v4
Expand Down

0 comments on commit c06e9fe

Please sign in to comment.