php-images-built #1934
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
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@master | |
with: | |
image: europe-docker.pkg.dev/flownative/docker/php:${{ matrix.php }} | |
label: org.opencontainers.image.version | |
registry_endpoint: https://europe-docker.pkg.dev | |
registry_username: '_json_key' | |
registry_password: ${{ secrets.GOOGLE_ARTIFACTS_PASSWORD_DOCKER }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
flavor: | | |
latest=false | |
images: | | |
flownative/beach-php | |
europe-docker.pkg.dev/flownative/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 <[email protected]> | |
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@v3 | |
- | |
name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }} | |
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }} | |
- name: Login to Google Artifacts Registry | |
uses: docker/login-action@v3 | |
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@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
build-args: | | |
PHP_BASE_IMAGE=europe-docker.pkg.dev/flownative/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@v3 | |
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@v3 | |
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: Send mail for Opsgenie heartbeat | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}} | |
subject: Github Actions heartbeat ping | |
to: [email protected] | |
from: Github Actions <[email protected]> | |
body: Build job of ${{github.repository}} completed successfully! |