Update #296
This file contains 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 Develop | |
on: [ push ] | |
env: | |
COMPOSER_VERSION: '2.6.5' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
name: Build PHP ${{ matrix.php-version }} Alpine ${{ matrix.alpine-version }} | |
runs-on: '${{ matrix.os }}' | |
env: | |
ALPINE_VERSION: '${{ matrix.alpine-version }}' | |
PHP_VERSION: '${{ matrix.php-version }}' | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
php-version: [ '8.0', '8.1', '8.2' ] | |
alpine-version: [ '3.14', '3.15', '3.16', '3.17', '3.18', 'edge' ] | |
exclude: | |
- php-version: '8.2' | |
alpine-version: '3.14' | |
- php-version: '8.2' | |
alpine-version: '3.15' | |
- php-version: '8.2' | |
alpine-version: '3.16' | |
- php-version: '8.2' | |
alpine-version: '3.17' | |
- php-version: '8.1' | |
alpine-version: '3.14' | |
- php-version: '8.1' | |
alpine-version: '3.15' | |
- php-version: '8.0' | |
alpine-version: '3.17' | |
- php-version: '8.0' | |
alpine-version: '3.18' | |
- php-version: '8.0' | |
alpine-version: 'edge' | |
max-parallel: 8 | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Fetch the PHP BUILD VERSION | |
id: fetch-php-build-version | |
shell: php {0} | |
run: | | |
<?php | |
$alpineVersion = getenv('ALPINE_VERSION'); | |
$phpVersion = getenv('PHP_VERSION'); | |
$version = match($phpVersion){ | |
'8.1' => '81', | |
'8.2' => '82', | |
default => substr($phpVersion, 0, 1) | |
}; | |
echo "::set-output name=version::" . $version . PHP_EOL; | |
- name: Build | |
run: export PHP_BUILD_VERSION=${{ steps.fetch-php-build-version.outputs.version }} && docker-compose build alpine-dev | |
- name: Login | |
run: docker login --username limingxinleo -p ${{ secrets.DOCKERHUB_ACCESSTOKEN }} | |
- name: Push | |
run: docker push hyperf/hyperf:${PHP_VERSION}-alpine-v${{ matrix.alpine-version }}-dev | |