Skip to content

CI/CD

CI/CD #112

Workflow file for this run

name: CI/CD
on: [push, workflow_dispatch]
env:
DOCKER_BUILDKIT: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.4', '8.1']
type: ['', '-prod']
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Build
run: |
docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-sqlsrv${{ matrix.type }} ${{ matrix.version }}-nginx-sqlsrv${{ matrix.type }}
- name: Tests
run: |
docker run kooldev/php:${{ matrix.version }}-nginx-sqlsrv${{ matrix.type }} php -r "extension_loaded('sqlsrv') or die(1);"
docker run kooldev/php:${{ matrix.version }}-nginx-sqlsrv${{ matrix.type }} php -r "extension_loaded('pdo_sqlsrv') or die(1);"
- name: Login to DockerHub
uses: docker/[email protected]
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-sqlsrv'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to DockerHub
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-sqlsrv'
run: |
docker push kooldev/php:${{ matrix.version }}-nginx-sqlsrv${{ matrix.type }}