diff --git a/.github/workflows/publish.5.yml b/.github/workflows/publish.5.yml index 3802321..19bff6b 100644 --- a/.github/workflows/publish.5.yml +++ b/.github/workflows/publish.5.yml @@ -15,11 +15,6 @@ jobs: matrix: version: [ '5.6' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' exclude: - version: '5.6' flavor: '-alpine' @@ -38,7 +33,16 @@ jobs: with: driver-opts: network=host - - name: Login to DockerHub + - name: Login to DockerHub (pull) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_PULL_USER_1 }} + password: ${{ secrets.DOCKER_PULL_PASS_1 }} + + - name: Pull base image + run: docker pull chialab/php:${{ matrix.version }}${{ matrix.flavor }} + + - name: Login to DockerHub (push) uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} @@ -60,7 +64,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: | chialab/php:${{ matrix.version }}${{ matrix.flavor }} ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} diff --git a/.github/workflows/publish.7.yml b/.github/workflows/publish.7.yml index 8f72250..c67fb86 100644 --- a/.github/workflows/publish.7.yml +++ b/.github/workflows/publish.7.yml @@ -15,11 +15,6 @@ jobs: matrix: version: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' exclude: - version: '7.0' flavor: '-alpine' @@ -38,7 +33,16 @@ jobs: with: driver-opts: network=host - - name: Login to DockerHub + - name: Login to DockerHub (pull) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_PULL_USER_2 }} + password: ${{ secrets.DOCKER_PULL_PASS_2 }} + + - name: Pull base image + run: docker pull chialab/php:${{ matrix.version }}${{ matrix.flavor }} + + - name: Login to DockerHub (push) uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} @@ -60,7 +64,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: | chialab/php:${{ matrix.version }}${{ matrix.flavor }} ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} diff --git a/.github/workflows/publish.8.yml b/.github/workflows/publish.8.yml index 159a6d9..7198ade 100644 --- a/.github/workflows/publish.8.yml +++ b/.github/workflows/publish.8.yml @@ -15,11 +15,6 @@ jobs: matrix: version: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' steps: - name: Checkout uses: actions/checkout@v4 @@ -33,7 +28,16 @@ jobs: with: driver-opts: network=host - - name: Login to DockerHub + - name: Login to DockerHub (pull) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_PULL_USER_3 }} + password: ${{ secrets.DOCKER_PULL_PASS_3 }} + + - name: Pull base image + run: docker pull chialab/php:${{ matrix.version }}${{ matrix.flavor }} + + - name: Login to DockerHub (push) uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} @@ -55,7 +59,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: | chialab/php:${{ matrix.version }}${{ matrix.flavor }} ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} diff --git a/.github/workflows/publish.compat.yml b/.github/workflows/publish.compat.yml index 7369156..03f38c7 100644 --- a/.github/workflows/publish.compat.yml +++ b/.github/workflows/publish.compat.yml @@ -31,8 +31,8 @@ jobs: - name: Login to DockerHub (pull) uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_PULL_USER_1 }} - password: ${{ secrets.DOCKER_PULL_PASS_1 }} + username: ${{ secrets.DOCKER_PULL_USER_4 }} + password: ${{ secrets.DOCKER_PULL_PASS_4 }} - name: Pull base image run: | diff --git a/.github/workflows/publish.latest.yml b/.github/workflows/publish.latest.yml new file mode 100644 index 0000000..2079f95 --- /dev/null +++ b/.github/workflows/publish.latest.yml @@ -0,0 +1,103 @@ +name: Publish latest PHP images + +on: + workflow_run: + workflows: ["Test latest PHP images"] + branches: [main] + types: [completed] + +jobs: + publish-8: + name: Build and publish PHP 8 images + runs-on: ubuntu-22.04 + if: ${{ github.event.workflow_run.conclusion == 'success' && !contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]') }} + strategy: + matrix: + version: [ 'latest', 'alpine' ] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + - name: Login to DockerHub (pull) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_PULL_USER_5 }} + password: ${{ secrets.DOCKER_PULL_PASS_5 }} + + - name: Pull base image + run: docker pull chialab/php:${{ matrix.version }} + + - name: Login to DockerHub (push) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build image and push to registry + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + cache-from: type=registry,ref=ghcr.io/chialab/php:${{ matrix.version }} + cache-to: type=inline + context: . + file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} + build-args: | + BASE_IMAGE=chialab/php:${{ matrix.version }} + tags: | + chialab/php:${{ matrix.version }} + ghcr.io/chialab/php:${{ matrix.version }} + push: true + + - name: Build dev image and push to registry + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + cache-to: type=inline + context: ./dev + build-args: | + BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }} + tags: | + chialab/php-dev:${{ matrix.version }} + ghcr.io/chialab/php-dev:${{ matrix.version }} + push: true + + - name: Build PCOV image and push to registry + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + cache-to: type=inline + context: ./pcov + build-args: | + BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }} + tags: | + chialab/php-pcov:${{ matrix.version }} + ghcr.io/chialab/php-pcov:${{ matrix.version }} + push: true + + - name: Build xhprof image (amd64 only) and push to registry + uses: docker/build-push-action@v5 + with: + cache-to: type=inline + context: ./xhprof + build-args: | + BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }} + tags: | + chialab/php-xhprof:${{ matrix.version }} + ghcr.io/chialab/php-xhprof:${{ matrix.version }} + push: true diff --git a/.github/workflows/test.5.yml b/.github/workflows/test.5.yml index 6214b52..a943037 100644 --- a/.github/workflows/test.5.yml +++ b/.github/workflows/test.5.yml @@ -18,11 +18,6 @@ jobs: matrix: version: [ '5.6' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' exclude: - version: '5.6' flavor: '-alpine' @@ -37,12 +32,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Login to GitHub Container Registry + - name: Login to DockerHub uses: docker/login-action@v3 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKER_PULL_USER_1 }} + password: ${{ secrets.DOCKER_PULL_PASS_1 }} - name: Build image for testing uses: docker/build-push-action@v5 @@ -52,7 +46,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} push: true diff --git a/.github/workflows/test.7.yml b/.github/workflows/test.7.yml index 6d8380d..14f8957 100644 --- a/.github/workflows/test.7.yml +++ b/.github/workflows/test.7.yml @@ -18,11 +18,6 @@ jobs: matrix: version: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' exclude: - version: '7.0' flavor: '-alpine' @@ -37,12 +32,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Login to GitHub Container Registry + - name: Login to DockerHub uses: docker/login-action@v3 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKER_PULL_USER_2 }} + password: ${{ secrets.DOCKER_PULL_PASS_2 }} - name: Build image for testing uses: docker/build-push-action@v5 @@ -52,7 +46,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} push: true diff --git a/.github/workflows/test.8.yml b/.github/workflows/test.8.yml index 213510e..667a636 100644 --- a/.github/workflows/test.8.yml +++ b/.github/workflows/test.8.yml @@ -18,11 +18,6 @@ jobs: matrix: version: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] - include: - - version: 'latest' - flavor: '' - - version: 'alpine' - flavor: '' services: registry: image: registry:2 @@ -32,12 +27,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Login to GitHub Container Registry + - name: Login to DockerHub uses: docker/login-action@v3 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKER_PULL_USER_3 }} + password: ${{ secrets.DOCKER_PULL_PASS_3 }} - name: Build image for testing uses: docker/build-push-action@v5 @@ -47,7 +41,7 @@ jobs: context: . file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} build-args: | - BASE_IMAGE=ghcr.io/chialab/php-mirror:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} push: true diff --git a/.github/workflows/test.compat.yml b/.github/workflows/test.compat.yml index 754b66b..44e1d6d 100644 --- a/.github/workflows/test.compat.yml +++ b/.github/workflows/test.compat.yml @@ -5,8 +5,7 @@ on: # chosen by fair dice roll - cron: '42 18 * * 2' push: - branches: - - main + branches: [main] pull_request: types: [opened, synchronize] @@ -31,8 +30,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_PULL_USER_1 }} - password: ${{ secrets.DOCKER_PULL_PASS_1 }} + username: ${{ secrets.DOCKER_PULL_USER_4 }} + password: ${{ secrets.DOCKER_PULL_PASS_4 }} - name: Build image for testing uses: docker/build-push-action@v5 diff --git a/.github/workflows/test.latest.yml b/.github/workflows/test.latest.yml new file mode 100644 index 0000000..08cac1a --- /dev/null +++ b/.github/workflows/test.latest.yml @@ -0,0 +1,99 @@ +name: Test latest PHP images + +on: + schedule: + # chosen by fair dice roll + - cron: '42 18 * * 1' + push: + branches: [main] + pull_request: + types: [opened, synchronize] + +jobs: + test-latest: + name: Build and test latest PHP images + runs-on: ubuntu-22.04 + if: ${{ !contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]') }} + strategy: + matrix: + version: [ 'latest', 'alpine' ] + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_PULL_USER_5 }} + password: ${{ secrets.DOCKER_PULL_PASS_5 }} + + - name: Build image for testing + uses: docker/build-push-action@v5 + with: + cache-from: type=registry,ref=ghcr.io/chialab/php:${{ matrix.version }} + cache-to: type=inline + context: . + file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }} + build-args: | + BASE_IMAGE=chialab/php:${{ matrix.version }} + tags: localhost:5000/chialab/php:${{ matrix.version }} + push: true + + - name: Test image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }} + run: 'docker pull localhost:5000/chialab/php:${{ matrix.version }} && make test' + + - name: Build dev image for testing + uses: docker/build-push-action@v5 + with: + cache-to: type=inline + context: ./dev + build-args: | + BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }} + tags: localhost:5000/chialab/php-dev:${{ matrix.version }} + push: true + + - name: Test dev image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }} + run: 'docker pull localhost:5000/chialab/php-dev:${{ matrix.version }} && make -C dev test' + + - name: Build PCOV image for testing + uses: docker/build-push-action@v5 + with: + cache-to: type=inline + context: ./pcov + build-args: | + BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }} + tags: localhost:5000/chialab/php-pcov:${{ matrix.version }} + push: true + + - name: Test PCOV image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }} + run: 'docker pull localhost:5000/chialab/php-pcov:${{ matrix.version }} && make -C pcov test' + + - name: Build xhprof image for testing + uses: docker/build-push-action@v5 + with: + cache-to: type=inline + context: ./xhprof + build-args: | + BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }} + tags: localhost:5000/chialab/php-xhprof:${{ matrix.version }} + push: true + + - name: Test xhprof image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }} + run: 'docker pull localhost:5000/chialab/php-xhprof:${{ matrix.version }} && make -C xhprof test'