Skip to content

Docker Image CI

Docker Image CI #225

Workflow file for this run

name: Docker Image CI
on:
push:
branches: '**'
tags: '**'
pull_request:
branches:
- 'master'
schedule:
- cron: 0 0 * * 6
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images:
laradock/workspace
flavor: |
suffix=-${{ matrix.php_version }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ (github.repository == 'laradock/workspace') && (github.ref == 'refs/heads/master') }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: Dockerfile-${{ matrix.php_version }}
platforms: linux/amd64,linux/arm64,linux/386
push: ${{ (github.repository == 'laradock/workspace') && (github.ref == 'refs/heads/master') }}
tags: ${{ steps.meta.outputs.tags }}