Skip to content

Merge pull request #36 from gradinarufelix/feature/add-libavif-bin #2628

Merge pull request #36 from gradinarufelix/feature/add-libavif-bin

Merge pull request #36 from gradinarufelix/feature/add-libavif-bin #2628

Workflow file for this run

name: Build Docker images
on:
repository_dispatch:
types: [php-images-built]
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ]
steps:
- uses: actions/checkout@v6
with:
ref: 'main'
fetch-depth: 100
- name: Determine latest released version
id: latest_version
uses: flownative/action-git-latest-release@v1
- run: |
sudo chmod -R ugo+rwX . && shopt -s dotglob && rm -rf *
- uses: actions/checkout@v6
with:
ref: ${{ steps.latest_version.outputs.tag }}
fetch-depth: 100
- name: Determine latest built PHP ${{ matrix.php }} version
id: latest_php_version
uses: flownative/action-docker-get-label@v1
with:
image: harbor.flownative.io/docker/php:${{ matrix.php }}
label: org.opencontainers.image.version
registry_endpoint: https://harbor.flownative.io
registry_username: ${{ secrets.HARBOR_DOCKER_USERNAME }}
registry_password: ${{ secrets.HARBOR_DOCKER_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
flavor: |
latest=false
images: |
flownative/beach-php
harbor.flownative.io/docker/beach-php
labels: |
org.opencontainers.image.title=Beach PHP
org.opencontainers.image.description=Docker image providing PHP for Beach and Local Beach
org.opencontainers.image.licenses=MIT
org.opencontainers.image.vendor=Flownative GmbH
org.opencontainers.image.authors=Robert Lemke <robert@flownative.com>
org.opencontainers.image.version=${{ steps.latest_php_version.outputs.value }}
tags: |
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_php_version.outputs.value }}
type=semver,pattern={{version}},value=${{ steps.latest_php_version.outputs.value }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v4
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }}
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}
- name: Login to Harbor
uses: docker/login-action@v4
with:
registry: harbor.flownative.io
username: ${{ secrets.HARBOR_DOCKER_USERNAME }}
password: ${{ secrets.HARBOR_DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: |
PHP_BASE_IMAGE=harbor.flownative.io/docker/php:${{ steps.latest_php_version.outputs.value }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
announce:
runs-on: ubuntu-latest
needs: build
steps:
- name: Dispatch to beach-php-k8s
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.FLOWNATIVE_BOT_TOKEN }}
repository: flownative/docker-beach-php-k8s
event-type: beach-php-images-built
client-payload: '{"image_name": "flownative/docker-php/beach-php"}'
- name: Dispatch to versions.flownative.io
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.FLOWNATIVE_BOT_TOKEN }}
repository: flownative/versions.flownative.io
event-type: beach-php-images-built
client-payload: '{"image_name": "flownative/docker-php/beach-php"}'
- name: Push heartbeat metric to Grafana Cloud
if: success()
env:
RW_URL: ${{ secrets.GRAFANA_METRICS_RW_URL }}
INSTANCE_ID: ${{ secrets.GRAFANA_METRICS_INSTANCE_ID }}
TOKEN: ${{ secrets.GRAFANA_METRICS_PUSH_TOKEN }}
run: |
set -euo pipefail
# Derive the Influx line-protocol push endpoint from the Prometheus
# remote-write endpoint (same account, different host/path).
INFLUX_URL="$(printf '%s' "$RW_URL" | sed -e 's#prometheus-#influx-#' -e 's#/api/prom/push#/api/v1/push/influx/write#')"
NOW="$(date +%s)"
curl -sf --retry 3 --retry-all-errors \
-u "${INSTANCE_ID}:${TOKEN}" \
-H 'Content-Type: text/plain' \
"${INFLUX_URL}" \
--data-binary "flownative_ci_last_success_timestamp,job=docker-build,image=beach-php seconds=${NOW}"