From 05f785626b39b3b1e95f4d427d009373b16df8d6 Mon Sep 17 00:00:00 2001 From: Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram Date: Wed, 27 Dec 2023 10:02:28 +0400 Subject: [PATCH] Remove Circle CI and add a test with GitHub Actions --- .circleci/config.yml | 345 -------------------------------------- .github/workflows/8.2.yml | 62 +++++++ README.md | 1 - 3 files changed, 62 insertions(+), 346 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/8.2.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 313a2af..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,345 +0,0 @@ -version: 2.1 -executors: - docker-publisher: - docker: - - image: cimg/base:2023.07 -jobs: - build-images-82-apache: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.2 - command: | - cd 8/8.2 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.2-apache --build-arg PHP_VERSION=8.2 -f Dockerfile.apache - docker tag ghcr.io/islamic-network/php:8.2-apache quay.io/islamic-network/php:8.2-apache - docker tag ghcr.io/islamic-network/php:8.2-apache islamicnetwork/php:8.2-apache - docker push ghcr.io/islamic-network/php:8.2-apache - docker push quay.io/islamic-network/php:8.2-apache - docker push islamicnetwork/php:8.2-apache - build-images-81-apache: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.1 - command: | - cd 8/8.1 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.1-apache --build-arg PHP_VERSION=8.1 -f Dockerfile.apache - docker tag ghcr.io/islamic-network/php:8.1-apache quay.io/islamic-network/php:8.1-apache - docker tag ghcr.io/islamic-network/php:8.1-apache islamicnetwork/php:8.1-apache - docker push ghcr.io/islamic-network/php:8.1-apache - docker push quay.io/islamic-network/php:8.1-apache - docker push islamicnetwork/php:8.1-apache - build-images-81-unit: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.1 - command: | - cd 8/8.1 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.1-unit -f Dockerfile.nunit - docker tag ghcr.io/islamic-network/php:8.1-unit quay.io/islamic-network/php:8.1-unit - docker tag ghcr.io/islamic-network/php:8.1-unit islamicnetwork/php:8.1-unit - docker push ghcr.io/islamic-network/php:8.1-unit - docker push quay.io/islamic-network/php:8.1-unit - docker push islamicnetwork/php:8.1-unit - build-images-82-unit: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.2 - command: | - cd 8/8.2 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.2-unit -f Dockerfile.nunit - docker tag ghcr.io/islamic-network/php:8.2-unit quay.io/islamic-network/php:8.2-unit - docker tag ghcr.io/islamic-network/php:8.2-unit islamicnetwork/php:8.2-unit - docker push ghcr.io/islamic-network/php:8.2-unit - docker push quay.io/islamic-network/php:8.2-unit - docker push islamicnetwork/php:8.2-unit - build-images-8-apache: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.0 - command: | - cd 8/8.0 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.0-apache --build-arg PHP_VERSION=8.0 -f Dockerfile.apache - docker tag ghcr.io/islamic-network/php:8.0-apache quay.io/islamic-network/php:8.0-apache - docker tag ghcr.io/islamic-network/php:8.0-apache islamicnetwork/php:8.0-apache - docker push ghcr.io/islamic-network/php:8.0-apache - docker push quay.io/islamic-network/php:8.0-apache - docker push islamicnetwork/php:8.0-apache - build-images-82-apache-dev: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.2 - command: | - cd 8/8.2 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.2-apache-dev --build-arg PHP_VERSION=8.2 -f Dockerfile.apache.dev - docker tag ghcr.io/islamic-network/php:8.2-apache-dev quay.io/islamic-network/php:8.2-apache-dev - docker tag ghcr.io/islamic-network/php:8.2-apache-dev islamicnetwork/php:8.2-apache-dev - docker push ghcr.io/islamic-network/php:8.2-apache-dev - docker push quay.io/islamic-network/php:8.2-apache-dev - docker push islamicnetwork/php:8.2-apache-dev - build-images-81-apache-dev: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.1 - command: | - cd 8/8.1 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.1-apache-dev --build-arg PHP_VERSION=8.1 -f Dockerfile.apache.dev - docker tag ghcr.io/islamic-network/php:8.1-apache-dev quay.io/islamic-network/php:8.1-apache-dev - docker tag ghcr.io/islamic-network/php:8.1-apache-dev islamicnetwork/php:8.1-apache-dev - docker push ghcr.io/islamic-network/php:8.1-apache-dev - docker push quay.io/islamic-network/php:8.1-apache-dev - docker push islamicnetwork/php:8.1-apache-dev - build-images-81-unit-dev: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.1 - command: | - cd 8/8.1 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.1-unit-dev -f Dockerfile.nunit.dev - docker tag ghcr.io/islamic-network/php:8.1-unit-dev quay.io/islamic-network/php:8.1-unit-dev - docker tag ghcr.io/islamic-network/php:8.1-unit-dev islamicnetwork/php:8.1-unit-dev - docker push ghcr.io/islamic-network/php:8.1-unit-dev - docker push quay.io/islamic-network/php:8.1-unit-dev - docker push islamicnetwork/php:8.1-unit-dev - build-images-82-unit-dev: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.2 - command: | - cd 8/8.2 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.2-unit-dev -f Dockerfile.nunit.dev - docker tag ghcr.io/islamic-network/php:8.2-unit-dev quay.io/islamic-network/php:8.2-unit-dev - docker tag ghcr.io/islamic-network/php:8.2-unit-dev islamicnetwork/php:8.2-unit-dev - docker push ghcr.io/islamic-network/php:8.2-unit-dev - docker push quay.io/islamic-network/php:8.2-unit-dev - docker push islamicnetwork/php:8.2-unit-dev - build-images-8-apache-dev: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.0 - command: | - cd 8/8.0 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.0-apache-dev --build-arg PHP_VERSION=8.0 -f Dockerfile.apache.dev - docker tag ghcr.io/islamic-network/php:8.0-apache-dev quay.io/islamic-network/php:8.0-apache-dev - docker tag ghcr.io/islamic-network/php:8.0-apache-dev islamicnetwork/php:8.0-apache-dev - docker push ghcr.io/islamic-network/php:8.0-apache-dev - docker push quay.io/islamic-network/php:8.0-apache-dev - docker push islamicnetwork/php:8.0-apache-dev - build-images-82-cli: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.2 - command: | - cd 8/8.2 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.2-cli --build-arg PHP_VERSION=8.2 -f Dockerfile.cli - docker tag ghcr.io/islamic-network/php:8.2-cli quay.io/islamic-network/php:8.2-cli - docker tag ghcr.io/islamic-network/php:8.2-cli islamicnetwork/php:8.2-cli - docker push ghcr.io/islamic-network/php:8.2-cli - docker push quay.io/islamic-network/php:8.2-cli - docker push islamicnetwork/php:8.2-cli - build-images-81-cli: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.1 - command: | - cd 8/8.1 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.1-cli --build-arg PHP_VERSION=8.1 -f Dockerfile.cli - docker tag ghcr.io/islamic-network/php:8.1-cli quay.io/islamic-network/php:8.1-cli - docker tag ghcr.io/islamic-network/php:8.1-cli islamicnetwork/php:8.1-cli - docker push ghcr.io/islamic-network/php:8.1-cli - docker push quay.io/islamic-network/php:8.1-cli - docker push islamicnetwork/php:8.1-cli - build-images-8-cli: - executor: docker-publisher - steps: - - checkout - - setup_remote_docker: - version: 20.10.24 - - run: - name: Build and publish PHP 8.0 - command: | - cd 8/8.0 - echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - echo "$QUAYIO_PASSWORD" | docker login quay.io -u "$QUAYIO_USERNAME" --password-stdin - - docker build . -t ghcr.io/islamic-network/php:8.0-cli --build-arg PHP_VERSION=8.0 -f Dockerfile.cli - docker tag ghcr.io/islamic-network/php:8.0-cli quay.io/islamic-network/php:8.0-cli - docker tag ghcr.io/islamic-network/php:8.0-cli islamicnetwork/php:8.0-cli - docker push ghcr.io/islamic-network/php:8.0-cli - docker push quay.io/islamic-network/php:8.0-cli - docker push islamicnetwork/php:8.0-cli -workflows: - version: 2 - build-and-publish: - jobs: - - build-images-82-unit: - context: org-global - filters: - branches: - only: master - - build-images-81-unit: - context: org-global - filters: - branches: - only: master - - build-images-82-apache: - context: org-global - filters: - branches: - only: master - - build-images-81-apache: - context: org-global - filters: - branches: - only: master - - build-images-8-apache: - context: org-global - filters: - branches: - only: master - - build-images-82-cli: - context: org-global - filters: - branches: - only: master - - build-images-81-cli: - context: org-global - filters: - branches: - only: master - - build-images-8-cli: - context: org-global - filters: - branches: - only: master - - build-images-82-apache-dev: - context: org-global - requires: - - build-images-82-apache - filters: - branches: - only: master - - build-images-82-unit-dev: - context: org-global - requires: - - build-images-82-unit - filters: - branches: - only: master - - build-images-81-unit-dev: - context: org-global - requires: - - build-images-81-unit - filters: - branches: - only: master - - build-images-81-apache-dev: - context: org-global - requires: - - build-images-81-apache - filters: - branches: - only: master - - build-images-8-apache-dev: - context: org-global - requires: - - build-images-8-apache - filters: - branches: - only: master diff --git a/.github/workflows/8.2.yml b/.github/workflows/8.2.yml new file mode 100644 index 0000000..0a75192 --- /dev/null +++ b/.github/workflows/8.2.yml @@ -0,0 +1,62 @@ +name: Build Dcoker Images for PHP 8.2 with Apache +on: + workflow_dispatch: + branches: + - master + paths: + - "8/8.2/*" + push: + branches: + - "master" + paths: + - "8/8.2/*" +jobs: + docker-build-and-push: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + ## Login to all 3 registries: DockerHub, GitHub Actions Container Registry, and Quay.io ## + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to the GitHub Actions Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Login to the Quay.io Container Registry + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + ## Build and push the Docker image ## + - name: Build and push the Apache Production Image + uses: docker/build-push-action@v5 + with: + context: 8/8.2 + file: 8/8.2/Dockerfile.apache + push: true + tags: | + islamicnetwork/php:8.2-apache + ghcr.io/islamic-network/php:8.2-apache + quay.io/islamic-network/php:8.2-apache + - name: Build and push the Apache Production Image + - name: Build and push the Apache Development Image + uses: docker/build-push-action@v5 + with: + context: 8/8.2 + file: 8/8.2/Dockerfile.apache.dev + build-args: | + PHP_VERSION=8.2 + push: true + tags: | + islamicnetwork/php:8.2-apache-dev + ghcr.io/islamic-network/php:8.2-apache-dev + quay.io/islamic-network/php:8.2-apache-dev diff --git a/README.md b/README.md index 6954719..83701ff 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![CircleCI](https://circleci.com/gh/islamic-network/php.svg?style=shield)](https://circleci.com/gh/islamic-network/php) [![](https://img.shields.io/github/license/islamic-network/php.svg)](https://github.com/islamic-network/php/blob/master/LICENSE.txt) ![Docker Pulls](https://img.shields.io/docker/pulls/islamicnetwork/php)