Skip to content

GitHub CI

GitHub CI #283

Workflow file for this run

name: GitHub CI
on:
push:
branches: '**'
tags: '**'
pull_request:
schedule:
- cron: '15 20 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [ '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6']
steps:
- name: Login to Docker Hub
if: ${{ (github.event_name != 'pull_request') && (github.ref == 'refs/heads/master') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
build-args: PHP_TAG_VERSION=${{ matrix.php_version }}
push: ${{ (github.event_name != 'pull_request') && (github.ref == 'refs/heads/master') }}
tags: letsdockerize/php:${{ matrix.php_version }}
- name: Image digest
run: |
echo ${{ steps.docker_build.outputs.digest }}
echo "Deploying to production server on branch $GITHUB_REF ${GITHUB_REF#refs/*/}"