name: Build haze images on: push: branches: ["main"] paths: - ".github/**" - "images/**" permissions: contents: read jobs: build-images: runs-on: ubuntu-latest strategy: matrix: php-version: ["8.1", "8.2", "8.3"] variant: ["", "-dbg"] name: haze-${{ matrix.php-version }}${{ matrix.variant }} steps: - name: Checkout repository uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: changes with: filters: | php: - '.github/**' - 'images/php/**' haze: - '.github/**' - 'images/php/**' - 'images/haze/**' - name: Log in to the Container registry uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build php image if: steps.changes.outputs.php == 'true' uses: docker/build-push-action@v5 with: context: "images/php" push: true tags: icewind1991/haze-php:${{ matrix.php-version }}${{ matrix.variant }} build-args: | PHP_VERSION=${{ matrix.php-version }} BASE_IMAGE=${{ matrix.variant == '-dbg' && 'icewind1991/php-dbg' || 'php' }} cache-from: type=gha cache-to: type=gha,mode=max - name: Build haze image if: steps.changes.outputs.haze == 'true' uses: docker/build-push-action@v5 with: context: "images/haze" push: true tags: icewind1991/haze:${{ matrix.php-version }}${{ matrix.variant }} build-args: | PHP_VERSION=${{ matrix.php-version }}${{ matrix.variant }} cache-from: type=gha cache-to: type=gha,mode=max