Skip to content

Build Docker Image #1420

Build Docker Image

Build Docker Image #1420

Workflow file for this run

name: Build Docker Image
on:
schedule:
- cron: '30 0 * * *'
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
php: [ 7.4.33, 8.0.30, 8.1.24, 8.2.11 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
fetch-depth: 100
- name: Determine latest version
id: latest_version
uses: flownative/action-git-latest-release@master
- run: |
sudo chmod -R ugo+rwX . && shopt -s dotglob && rm -rf *
- uses: actions/checkout@v3
with:
ref: ${{ steps.latest_version.outputs.tag }}
fetch-depth: 100
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=false
images: |
flownative/php
europe-docker.pkg.dev/flownative/docker/php
labels: |
org.opencontainers.image.title=PHP
org.opencontainers.image.description=Docker image providing PHP CLI and PHP-FPM with various extensions pre-installed
org.opencontainers.image.licenses=MIT
org.opencontainers.image.vendor=Flownative GmbH
org.opencontainers.image.version=${{ matrix.php }}
tags: |
type=semver,pattern={{major}}.{{minor}},value=${{ matrix.php }}
type=semver,pattern={{version}},value=${{ matrix.php }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }}
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}
- name: Login to Google Artifacts Registry
uses: docker/login-action@v2
with:
registry: europe-docker.pkg.dev/flownative/docker
username: '_json_key'
password: ${{ secrets.GOOGLE_ARTIFACTS_PASSWORD_DOCKER }}
- name: Build Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: |
PHP_VERSION=${{ matrix.php }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
announce:
runs-on: ubuntu-latest
needs: build
steps:
- name: Dispatch to beach-php
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.FLOWNATIVE_BOT_TOKEN }}
repository: flownative/docker-beach-php
event-type: php-images-built
client-payload: '{"image_name": "flownative/docker-php/php"}'
- name: Dispatch to composer
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.FLOWNATIVE_BOT_TOKEN }}
repository: flownative/docker-composer
event-type: php-images-built
client-payload: '{"image_name": "flownative/docker-php/php"}'