From 2ac48e197b746721266b44f92f02e764f1fb3ccb Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 11:08:07 +0200 Subject: [PATCH] add github workflow --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1b9ec41 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: "Build PHP docker image with xdebug module." +on: + push: + pull_request: + schedule: + # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule + # every tuesday(2) at 06:32 UTC (chosen randomly) + # Minute[0,59] Hour[0,23] DOM[1,31] MOY[1,12] DOW[0,6] + - cron: '32 6 * * 2' + + workflow_dispatch: + +permissions: + contents: "read" + +jobs: + docker: + runs-on: "ubuntu-latest" + strategy: + matrix: + php-version: + - "8.1" + - "8.2" + - "8.3" + steps: + - name: "Set up QEMU" + uses: "docker/setup-qemu-action@v2" + - name: "Set up Docker Buildx" + uses: "docker/setup-buildx-action@v2" + - name: "Login to Docker Hub" + uses: "docker/login-action@v2" + with: + username: "${{ secrets.DOCKERHUB_USERNAME }}" + password: "${{ secrets.DOCKERHUB_TOKEN }}" + - name: "Build PHP ${{ matrix.php-version }}" + uses: "docker/build-push-action@v4" + with: + build-args: "PHP_VERSION=${{ matrix.php-version }}-cli" + push: true + tags: "${{ secrets.DOCKERHUB_USERNAME }}/php-xdebug:${{ matrix.php-version }}"