name: Build and push PHP 7 container images on: push: branches: - php7-alpine jobs: builder: name: Build PHP 7 builder container images runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest strategy: matrix: flavors: - os: "alpine" os_version: "3.9" php_version: "7.2" php_ver_short: "7" - os: "alpine" os_version: "3.12" php_version: "7.3" php_ver_short: "7" - os: "alpine" os_version: "3.15" php_version: "7.4" php_ver_short: "7" steps: - name: Check out repository code uses: actions/checkout@v4 - name: Login to quay.io uses: docker/login-action@v3 with: registry: quay.io username: ${{ vars.QUAY_USERNAME }} password: ${{ secrets.QUAY_SECRET }} # - name: Set up QEMU # uses: docker/setup-qemu-action@v3 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 - name: Build and push php7 builder uses: docker/build-push-action@v5 with: push: true context: . file: 7/Dockerfile.${{ matrix.flavors.os }}-builder build-args: | OS_VERSION=${{ matrix.flavors.os_version }} PHP_VERSION=${{ matrix.flavors.php_version }} PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} tags: | quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-builder-${{ matrix.flavors.os }} # flavors: # name: Build PHP 7 container images # runs-on: ubuntu-latest # container: # image: ghcr.io/catthehacker/ubuntu:act-latest # strategy: # matrix: # flavors: # - os: "alpine" # os_version: "3.15" # php_version: "7.4" # php_ver_short: "7" # mode: cli # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.15" # php_version: "7.4" # php_ver_short: "7" # mode: full # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.15" # php_version: "7.4" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "false" # - os: "alpine" # os_version: "3.15" # php_version: "7.4" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "mysql" # - os: "alpine" # os_version: "3.15" # php_version: "7.4" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "postgresql" # - os: "alpine" # os_version: "3.12" # php_version: "7.3" # php_ver_short: "7" # mode: cli # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.12" # php_version: "7.3" # php_ver_short: "7" # mode: full # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.12" # php_version: "7.3" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "false" # - os: "alpine" # os_version: "3.12" # php_version: "7.3" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "mysql" # - os: "alpine" # os_version: "3.12" # php_version: "7.3" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "postgresql" # - os: "alpine" # os_version: "3.9" # php_version: "7.2" # php_ver_short: "7" # mode: cli # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.9" # php_version: "7.2" # php_ver_short: "7" # mode: full # with_server: "false" # with_database: "false" # - os: "alpine" # os_version: "3.9" # php_version: "7.2" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "false" # - os: "alpine" # os_version: "3.9" # php_version: "7.2" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "mysql" # - os: "alpine" # os_version: "3.9" # php_version: "7.2" # php_ver_short: "7" # mode: full # with_server: "apache" # with_database: "postgresql" # steps: # - name: Check out repository code # uses: actions/checkout@v4 # - name: Login to quay.io # uses: docker/login-action@v3 # with: # registry: quay.io # username: ${{ vars.QUAY_USERNAME }} # password: ${{ secrets.QUAY_SECRET }} # # - name: Set up QEMU # # uses: docker/setup-qemu-action@v3 # - name: Setup Docker buildx # uses: docker/setup-buildx-action@v3 # - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }} # name: Build and push php7 # uses: docker/build-push-action@v5 # with: # push: true # context: . # file: 7/Dockerfile.${{ matrix.flavors.os }} # build-args: | # OS_VERSION=${{ matrix.flavors.os_version }} # FLAVOR=${{ matrix.flavors.mode }} # PHP_VERSION=${{ matrix.flavors.php_version }} # PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} # tags: | # quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.os }} # - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }} # name: Build and push php7 with webserver # uses: docker/build-push-action@v5 # with: # push: true # context: . # file: 7/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} # build-args: | # OS_VERSION=${{ matrix.flavors.os_version }} # FLAVOR=${{ matrix.flavors.mode }} # PHP_VERSION=${{ matrix.flavors.php_version }} # PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} # WITH_APACHE=true # tags: | # quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} # - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }} # name: Build and push php7 with apache2 and database connector library # uses: docker/build-push-action@v5 # with: # push: true # context: . # file: 7/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} # build-args: | # OS_VERSION=${{ matrix.flavors.os_version }} # FLAVOR=${{ matrix.flavors.mode }} # PHP_VERSION=${{ matrix.flavors.php_version }} # PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} # WITH_APACHE=true # WITH_DATABASE=${{ matrix.flavors.with_database }} # tags: | # quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }}