Add GitHub workflows for building Alpine PHP test images and extensio… #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Alpine PHP test images (NTS) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - .github/workflows/Dockerfile.alpine-php-test-nts | |
| - .github/workflows/build-alpine-php-test-images-nts.yml | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: aikidosec/firewall-php-test-alpine-nts | |
| VERSION: v1 | |
| jobs: | |
| build-amd64: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| php_version: ['7.4','8.0','8.1','8.2','8.3','8.4','8.5'] | |
| fail-fast: false | |
| permissions: { contents: read, packages: write } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push (amd64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: .github/workflows/Dockerfile.alpine-php-test-nts | |
| platforms: linux/amd64 | |
| push: true | |
| build-args: | | |
| PHP_VERSION=${{ matrix.php_version }} | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php_version }}-amd64-${{ env.VERSION }} | |
| build-arm64: | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| matrix: | |
| php_version: ['7.4','8.0','8.1','8.2','8.3','8.4','8.5'] | |
| fail-fast: false | |
| permissions: { contents: read, packages: write } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push (arm64) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: .github/workflows/Dockerfile.alpine-php-test-nts | |
| platforms: linux/arm64 | |
| push: true | |
| build-args: | | |
| PHP_VERSION=${{ matrix.php_version }} | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php_version }}-arm64-${{ env.VERSION }} | |
| publish-manifests: | |
| runs-on: ubuntu-24.04 | |
| needs: [build-amd64, build-arm64] | |
| strategy: | |
| matrix: | |
| php_version: ['7.4','8.0','8.1','8.2','8.3','8.4','8.5'] | |
| fail-fast: false | |
| permissions: { contents: read, packages: write } | |
| steps: | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create multi-arch manifest | |
| run: | | |
| IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| V=${{ matrix.php_version }} | |
| docker buildx imagetools create \ | |
| --tag ${IMAGE}:${V}-${{ env.VERSION }} \ | |
| ${IMAGE}:${V}-amd64-${{ env.VERSION }} \ | |
| ${IMAGE}:${V}-arm64-${{ env.VERSION }} |