diff --git a/.docker/Dockerfile.apache b/.docker/Dockerfile.apache index fdd06970..03ef79b6 100644 --- a/.docker/Dockerfile.apache +++ b/.docker/Dockerfile.apache @@ -1,4 +1,6 @@ -FROM php:8.3-apache +FROM php:8.3.36-apache@sha256:756c2884677bedea30afaa95811b42cd3ff251203291c5820c1ad209e86c9fb4 + + LABEL vendor="Mautic" LABEL maintainer="LibreCode coop" diff --git a/.docker/Dockerfile.fpm b/.docker/Dockerfile.fpm index 9effafea..369623cd 100644 --- a/.docker/Dockerfile.fpm +++ b/.docker/Dockerfile.fpm @@ -1,4 +1,6 @@ -FROM php:8.3-fpm +FROM php:8.3.36-fpm@sha256:d0dea3f5d95314eac94a732469f4cf0ee658a22c2ce3f2612272b9d5b42d1a72 + + LABEL vendor="Mautic" LABEL maintainer="LibreCode coop" diff --git a/.docker/scripts/entrypoint_mautic_cron.sh b/.docker/scripts/entrypoint_mautic_cron.sh index 586359c7..3b63faec 100644 --- a/.docker/scripts/entrypoint_mautic_cron.sh +++ b/.docker/scripts/entrypoint_mautic_cron.sh @@ -65,6 +65,7 @@ chmod 777 /tmp/stdout # so the jobs need an explicit shell environment. { declare -p | grep -E '^(declare -x (PHP_INI_VALUE_|MAUTIC_DB_|MAUTIC_SITE_URL))' + # shellcheck disable=SC2016 printf '%s\n' 'if [ -n "${MAUTIC_DB_NAME:-}" ] && [ -z "${MAUTIC_DB_DATABASE:-}" ]; then export MAUTIC_DB_DATABASE="$MAUTIC_DB_NAME"; fi' } > /tmp/cron.env diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index 94e1c052..84f077cb 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -1,6 +1,9 @@ name: Build and publish a Docker image on: + pull_request: + branches: + - main push: branches: - main @@ -34,7 +37,7 @@ jobs: name: Build image runs-on: ubuntu-latest env: - MAUTIC_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.mautic_version || (github.ref == 'refs/heads/main' && '7.x-dev') || github.ref_name }} + MAUTIC_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.mautic_version || (github.event_name == 'pull_request' && '7.x-dev') || (github.ref == 'refs/heads/main' && '7.x-dev') || github.ref_name }} strategy: fail-fast: false matrix: @@ -58,6 +61,7 @@ jobs: type=semver,pattern={{major}}.{{minor}},value=${{ env.MAUTIC_VERSION }},enable=${{ github.event_name == 'workflow_dispatch' && inputs.overwrite_latest_minor }} type=semver,pattern={{major}},value=${{ env.MAUTIC_VERSION }},enable=${{ github.event_name == 'workflow_dispatch' && inputs.overwrite_latest_major }} type=raw,value=7.x-dev,enable=${{ github.ref == 'refs/heads/main' }},suffix=-${{ matrix.image_type }} + type=raw,value=pr-check,enable=${{ github.event_name == 'pull_request' }} type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' && inputs.tag_as_latest && matrix.image_type == 'apache' }},suffix= flavor: | latest=false @@ -75,6 +79,7 @@ jobs: restore-keys: | ${{ matrix.image_type }}-buildx- - name: Log in to GitHub Container Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io @@ -83,7 +88,8 @@ jobs: - name: Build and publish container image uses: docker/build-push-action@v6 with: - push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || inputs.publish }} + pull: true + push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || inputs.publish == true }} context: .docker platforms: linux/amd64,linux/arm64 file: .docker/Dockerfile.${{ matrix.image_type }}