From e3cee5d2849c62348567798b3393b43c58a8f1cf Mon Sep 17 00:00:00 2001 From: "Dr.Reeves" <86178816+NerdsCorp@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:31:27 -0500 Subject: [PATCH 1/3] Enhance Docker publish workflow with scheduling Added a scheduled cron job to trigger builds and updated version handling for scheduled events. --- .github/workflows/docker-publish.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7f02df5b8b..22d9334d91 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -7,6 +7,8 @@ on: release: types: - published + schedule: + - cron: '0 0 * * 1' env: REGISTRY: ghcr.io @@ -112,6 +114,14 @@ jobs: echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + # Fetch the latest release tag from GitHub API for use in scheduled builds + - name: Get latest release tag (scheduled) + id: release_info + if: github.event_name == 'schedule' + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') + echo "version_tag=${LATEST_TAG/v/}" >> $GITHUB_OUTPUT + # Download the base PHP image AMD64 - uses: actions/download-artifact@v4 with: @@ -133,20 +143,20 @@ jobs: rm base-php-arm64.tar base-php-amd64.tar - name: Update version in config/app.php (tag) - if: "github.event_name == 'release' && github.event.action == 'published'" + if: "(github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'schedule'" run: | - sed -i "s/'version' => 'canary',/'version' => '${{ steps.build_info.outputs.version_tag }}',/" config/app.php + sed -i "s/'version' => 'canary',/'version' => '${{ steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }}',/" config/app.php - name: Build and Push (tag) uses: docker/build-push-action@v6 - if: "github.event_name == 'release' && github.event.action == 'published'" + if: "(github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'schedule'" with: context: . file: ./Dockerfile push: true platforms: 'linux/amd64,linux/arm64' build-args: | - VERSION=${{ steps.build_info.outputs.version_tag }} + VERSION=${{ steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }} labels: ${{ steps.docker_meta.outputs.labels }} tags: ${{ steps.docker_meta.outputs.tags }} cache-from: type=gha,scope=tagged${{ matrix.os }} From 3b71d14354707892fbc6e19d3b514a2024349f20 Mon Sep 17 00:00:00 2001 From: "Dr.Reeves" <86178816+NerdsCorp@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:49:28 -0500 Subject: [PATCH 2/3] rabbit fixes --- .github/workflows/docker-publish.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 22d9334d91..830aa3321a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -77,8 +77,23 @@ jobs: # Always run against a tag, even if the commit into the tag has [docker skip] within the commit message. if: "!contains(github.ref, 'main') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))" steps: + # Fetch the latest release tag from GitHub API before checkout so we can check out the correct ref + - name: Get latest release tag (scheduled) + id: release_info + if: github.event_name == 'schedule' + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') + if [ "$LATEST_TAG" = "null" ] || [ -z "$LATEST_TAG" ]; then + echo "No release found, exiting" + exit 1 + fi + echo "version_tag=${LATEST_TAG/v/}" >> $GITHUB_OUTPUT + echo "schedule_tag=$LATEST_TAG" >> $GITHUB_OUTPUT + - name: Code checkout uses: actions/checkout@v4 + with: + ref: ${{ steps.release_info.outputs.schedule_tag || github.ref }} - name: Docker metadata id: docker_meta @@ -114,14 +129,6 @@ jobs: echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - # Fetch the latest release tag from GitHub API for use in scheduled builds - - name: Get latest release tag (scheduled) - id: release_info - if: github.event_name == 'schedule' - run: | - LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') - echo "version_tag=${LATEST_TAG/v/}" >> $GITHUB_OUTPUT - # Download the base PHP image AMD64 - uses: actions/download-artifact@v4 with: From a32bf5a36084c5231daf0672b269b277adf9d647 Mon Sep 17 00:00:00 2001 From: "Dr.Reeves" <86178816+NerdsCorp@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:59:39 -0500 Subject: [PATCH 3/3] Enhance Docker publish workflow with better version checks Updated Docker publish workflow to improve tag fetching and version handling and hopefully make rabbit happy. --- .github/workflows/docker-publish.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 830aa3321a..4b6701bc13 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -77,17 +77,23 @@ jobs: # Always run against a tag, even if the commit into the tag has [docker skip] within the commit message. if: "!contains(github.ref, 'main') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))" steps: - # Fetch the latest release tag from GitHub API before checkout so we can check out the correct ref + # Fetch the latest release tag from GitHub API before checkout and metadata so we can check out the correct ref and tag the image - name: Get latest release tag (scheduled) id: release_info if: github.event_name == 'schedule' run: | - LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') + LATEST_TAG=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -w "\n%{http_code}" https://api.github.com/repos/${{ github.repository }}/releases/latest | tail -1 | head -1) + HTTP_CODE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -w "%{http_code}" -o /dev/null https://api.github.com/repos/${{ github.repository }}/releases/latest) + if [ "$HTTP_CODE" != "200" ]; then + echo "Failed to fetch latest release (HTTP $HTTP_CODE)" + exit 1 + fi + LATEST_TAG=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') if [ "$LATEST_TAG" = "null" ] || [ -z "$LATEST_TAG" ]; then - echo "No release found, exiting" + echo "No release found" exit 1 fi - echo "version_tag=${LATEST_TAG/v/}" >> $GITHUB_OUTPUT + echo "version_tag=${LATEST_TAG#v}" >> $GITHUB_OUTPUT echo "schedule_tag=$LATEST_TAG" >> $GITHUB_OUTPUT - name: Code checkout @@ -103,7 +109,8 @@ jobs: flavor: | latest=false tags: | - type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false }} + type=raw,value=latest,enable=${{ (github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false) || github.event_name == 'schedule' }} + type=raw,value=${{ steps.release_info.outputs.version_tag }},enable=${{ github.event_name == 'schedule' }} type=ref,event=tag type=ref,event=branch @@ -126,7 +133,7 @@ jobs: - name: Get Build Information id: build_info run: | - echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT + echo "version_tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT # Download the base PHP image AMD64 @@ -152,7 +159,12 @@ jobs: - name: Update version in config/app.php (tag) if: "(github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'schedule'" run: | - sed -i "s/'version' => 'canary',/'version' => '${{ steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }}',/" config/app.php + VERSION="${{ github.event_name == 'schedule' && steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }}" + if [ -z "$VERSION" ] || [ "$VERSION" = "refs/heads/main" ]; then + echo "Invalid version tag, refusing to update config" + exit 1 + fi + sed -i "s/'version' => 'canary',/'version' => '$VERSION',/" config/app.php - name: Build and Push (tag) uses: docker/build-push-action@v6 @@ -163,7 +175,7 @@ jobs: push: true platforms: 'linux/amd64,linux/arm64' build-args: | - VERSION=${{ steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }} + VERSION=${{ github.event_name == 'schedule' && steps.release_info.outputs.version_tag || steps.build_info.outputs.version_tag }} labels: ${{ steps.docker_meta.outputs.labels }} tags: ${{ steps.docker_meta.outputs.tags }} cache-from: type=gha,scope=tagged${{ matrix.os }}