mirror of
https://github.com/Dannecron/php-for-dev.git
synced 2025-12-25 16:12:35 +03:00
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
name: continuous integration
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '.github/workflows/**'
|
|
- '.env'
|
|
- 'v*/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to docker hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Read .env file
|
|
uses: cardinalby/export-env-action@v2
|
|
with:
|
|
envFile: '.env'
|
|
|
|
- name: Build the Docker images ${{ matrix.php_version }}
|
|
run: |
|
|
docker buildx build --push \
|
|
--platform=linux/amd64,linux/arm64 \
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
--build-arg COMPOSER_VERSION=${{ env.COMPOSER_VERSION }} \
|
|
--build-arg XDEBUG_VERSION=${{ env.XDEBUG_VERSION }} \
|
|
--cache-from="type=registry,ref=dannecron/php-for-dev:${{ matrix.php_version }}.cache,mode=max" \
|
|
--cache-to="type=registry,ref=dannecron/php-for-dev:${{ matrix.php_version }}.cache,mode=max" \
|
|
--tag=dannecron/php-for-dev:${{ matrix.php_version }} \
|
|
$(if test "${{ matrix.php_version }}" = "8.0"; then printf %s '--tag=dannecron/php-for-dev:latest'; fi) \
|
|
./v${{ matrix.php_version }}
|
|
echo "Done"
|
|
|
|
|