Skip to content

Commit

Permalink
ci: fix scheduled Docker images build
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jan 30, 2024
1 parent 36a6daa commit 59dd042
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ jobs:
echo php82_version="${PHP_82_LATEST//./-}"
echo php83_version="${PHP_83_LATEST//./-}"
} >> "${GITHUB_OUTPUT}"
# Check if the Docker images must be rebuilt
if [[ "${GITHUB_EVENT_NAME}" != "schedule" ]]; then
echo skip=false >> "${GITHUB_OUTPUT}"
exit 0
fi

FRANKENPHP_82_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:latest-php8.2 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
FRANKENPHP_83_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:latest-php8.3 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')

if [[ "${FRANKENPHP_82_LATEST}" == "${PHP_82_LATEST}" ]] && [[ "${FRANKENPHP_83_LATEST}" == "${PHP_83_LATEST}" ]]; then
echo skip=true >> "${GITHUB_OUTPUT}"
exit 0
fi

{
echo ref="$(gh release view --repo dunglas/frankenphp --json tagName --jq '.tagName')"
echo skip=false
Expand Down Expand Up @@ -87,6 +87,7 @@ jobs:
SHA: ${{ github.sha }}
VERSION: ${{ (github.ref_type == 'tag' && github.ref_name) || steps.check.outputs.ref || github.sha }}
PHP_VERSION: ${{ steps.check.outputs.php_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -196,8 +197,7 @@ jobs:
retention-days: 1
-
name: Run tests
if: '!matrix.qemu'
continue-on-error: ${{ fromJson(needs.prepare.outputs.push) }}
if: ${{ !matrix.qemu && !fromJson(needs.prepare.outputs.push) }}
run: |
docker run --platform=${{ matrix.platform }} --rm \
"$(jq -r '."builder-${{ matrix.variant }}"."containerimage.config.digest"' <<< "${METADATA}")" \
Expand Down

0 comments on commit 59dd042

Please sign in to comment.