Skip to content

Scheduled Build

Scheduled Build #293

name: Scheduled Build
on:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch: # for debugging
concurrency:
group: ${{ github.workflow }}-${{ inputs.php-version }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
packages: read
strategy:
fail-fast: false
matrix:
php:
- 8.3
- 8.4
- 8.5
steps:
- name: Check Out
uses: actions/checkout@v6
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: nayleen
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compare Base Image Digest with Latest Release
id: compare-base-image
run: |
FULL_VERSION=$(./tools/resolve-php-version.sh ${{ matrix.php }})
BASE_IMAGE="docker.io/php:$FULL_VERSION-cli"
IMAGE="ghcr.io/nayleen/php:${{ matrix.php }}-amd64"
if ./tools/compare-digests.sh "$IMAGE" "$BASE_IMAGE"; then
echo "rebuild=false" >> $GITHUB_OUTPUT
else
echo "rebuild=true" >> $GITHUB_OUTPUT
fi
- name: Build PHP${{ matrix.php }} Images
if: ${{ steps.compare-base-image.outputs.rebuild == 'true' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: build.yaml
inputs: '{ "php-version": "${{ matrix.php }}" }'