PHP #92
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: PHP | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'php/**' | |
- '.github/workflows/php.yaml' | |
pull_request: | |
paths: | |
- 'php/**' | |
- '.github/workflows/php.yaml' | |
schedule: | |
- cron: '0 0 1,15 * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: ${{ matrix.php }}-${{ matrix.type }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ['5', '7.0', '7.1', '7.2', '7.3', '7.4', '7', '8.0', '8.1', '8.2'] | |
type: [apache, cli, fpm] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the image | |
run: | | |
cd php/${{ matrix.php }}/${{ matrix.type }} | |
docker build . --tag monsieurbiz/php:${{ matrix.php }}-${{ matrix.type }} | |
docker images | |
- name: Push the image | |
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' | |
run: | | |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} | |
docker push monsieurbiz/php:${{ matrix.php }}-${{ matrix.type }} |