Skip to content

ci

ci #525

Workflow file for this run

name: ci
on:
schedule:
- cron: '0 10 * * *' # every day at 10am
push:
branches:
- 'main'
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
matrix:
php: [ "7.2", "7.3", "7.4", "8.0", "8.1", "8.2" ]
node: [ "12", "14", "16", "18" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Image Update Checker
id: baseupdatecheck
uses: lucacome/[email protected]
with:
base-image: "thecodingmachine/php:${{ matrix.php }}-v4-slim-cli"
image: "kellerkinder/pipeline-image:PHP_${{ matrix.php }}-NODE_${{ matrix.node }}"
continue-on-error: true
- name: Set up QEMU
uses: docker/[email protected]
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}
- name: Build
id: docker_build
uses: docker/[email protected]
with:
context: .
push: true
tags: "localhost:5000/kellerkinder/pipeline-image:PHP_${{ matrix.php }}-NODE_${{ matrix.node }}"
build-args: |
PHP_VERSION=${{ matrix.php }}
NODE_VERSION=${{ matrix.node }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}
- name: Test
run: |
docker buildx imagetools inspect localhost:5000/kellerkinder/pipeline-image:PHP_${{ matrix.php }}-NODE_${{ matrix.node }}
docker run --rm localhost:5000/kellerkinder/pipeline-image:PHP_${{ matrix.php }}-NODE_${{ matrix.node }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}
- name: Push
id: docker_build_push
uses: docker/[email protected]
with:
push: true
tags: "kellerkinder/pipeline-image:PHP_${{ matrix.php }}-NODE_${{ matrix.node }}"
build-args: |
PHP_VERSION=${{ matrix.php }}
NODE_VERSION=${{ matrix.node }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || steps.baseupdatecheck.outputs.needs-updating == 'true' }}