name: Build and publish on: push: branches: - master - main workflow_dispatch: jobs: build_latest: runs-on: ubuntu-latest strategy: matrix: tag: [php8, php7.4, php7.1] image: [carlosalgms/composer-and-node-ci] latest: [php8] include: - tag: php8 buildArgs: "" - tag: php7.4 buildArgs: | PHP_VERSION=7.4 - tag: php7.1 buildArgs: | PHP_VERSION=7.1 DEPLOYER_VERSION=v6.6.0 COMPOSER_VERSION=2.2.21 env: TAGGED_IMAGE: ${{ matrix.image }}:${{ matrix.tag }} TAGS: ${{ matrix.tag == matrix.latest && format('{0}:latest,', matrix.image) || '' }}${{ matrix.image }}:${{ matrix.tag }} steps: - uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub id: docker_login uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Build and push id: docker_build uses: docker/build-push-action@v3 with: context: . pull: true push: true platforms: linux/amd64,linux/arm64 # platforms: linux/amd64,linux/arm64,linux/arm/v7 cache-from: ${{ env.TAGGED_IMAGE }} cache-to: type=inline build-args: ${{ matrix.buildArgs }} tags: ${{ env.TAGS }}