This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
Release #130
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: Release | |
on: | |
schedule: | |
- cron: '15 2 1,15 * *' | |
- cron: '30 2 1,15 * *' | |
- cron: '45 2 1,15 * *' | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'PHP version' | |
required: true | |
default: 8.3 | |
type: choice | |
options: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
env: | |
DEFAULT_VERSION: 8.3 | |
jobs: | |
release: | |
name: Build & Push image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Change PHP version to 8.2 | |
if: github.event.schedule == '30 2 1,15 * *' | |
run: | | |
echo "DEFAULT_VERSION=8.2" >> $GITHUB_ENV | |
- name: Change PHP version to 8.1 | |
if: github.event.schedule == '45 2 1,15 * *' | |
run: | | |
echo "DEFAULT_VERSION=8.1" >> $GITHUB_ENV | |
- name: Get semver versions | |
id: phpversion | |
run: | | |
version_major=$(docker run --rm php:${{ inputs.version || env.DEFAULT_VERSION }}-fpm-bookworm php -r 'echo explode(".",phpversion(),3)[0];'); | |
echo "version_major=$version_major" >> $GITHUB_OUTPUT; | |
version_minor=$(docker run --rm php:${{ inputs.version || env.DEFAULT_VERSION }}-fpm-bookworm php -r 'echo explode(".",phpversion(),3)[1];'); | |
echo "version_minor=$version_minor" >> $GITHUB_OUTPUT; | |
version_patch=$(docker run --rm php:${{ inputs.version || env.DEFAULT_VERSION }}-fpm-bookworm php -r 'echo explode(".",phpversion(),3)[2];'); | |
echo "version_patch=$version_patch" >> $GITHUB_OUTPUT; | |
enable_major_latest_version=false | |
if [[ "$version_major.$version_minor" == ${{ env.DEFAULT_VERSION }} ]]; then | |
enable_major_latest_version=true | |
fi | |
echo "enable_major_latest_version=$enable_major_latest_version" >> $GITHUB_OUTPUT | |
- name: Docker meta - PHP-FPM bookworm | |
id: meta_bookworm | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
docker.io/t0shy/phpfpm-bookworm | |
ghcr.io/toshy/phpfpm-bookworm | |
tags: | | |
type=raw,value=latest,enable=${{ steps.phpversion.outputs.enable_major_latest_version }} | |
type=raw,value=${{ steps.phpversion.outputs.version_major }},enable=${{ steps.phpversion.outputs.enable_major_latest_version }} | |
type=raw,value=${{ steps.phpversion.outputs.version_major }}.${{ steps.phpversion.outputs.version_minor }},enable=true | |
type=raw,value=${{ steps.phpversion.outputs.version_major }}.${{ steps.phpversion.outputs.version_minor }}.${{ steps.phpversion.outputs.version_patch }},enable=true | |
- name: Build & Push - PHP-FPM bookworm | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
target: phpfpm-bookworm | |
build-args: | | |
PHP_VERSION=${{ inputs.version || env.DEFAULT_VERSION }} | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta_bookworm.outputs.tags }} | |
labels: ${{ steps.meta_bookworm.outputs.labels }} | |
- name: Docker meta - PHP-FPM bookworm FFmpeg | |
id: meta_bookworm_ffmpeg | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
docker.io/t0shy/phpfpm-bookworm-ffmpeg | |
ghcr.io/toshy/phpfpm-bookworm-ffmpeg | |
tags: | | |
type=raw,value=latest,enable=${{ steps.phpversion.outputs.enable_major_latest_version }} | |
type=raw,value=${{ steps.phpversion.outputs.version_major }},enable=${{ steps.phpversion.outputs.enable_major_latest_version }} | |
type=raw,value=${{ steps.phpversion.outputs.version_major }}.${{ steps.phpversion.outputs.version_minor }},enable=true | |
type=raw,value=${{ steps.phpversion.outputs.version_major }}.${{ steps.phpversion.outputs.version_minor }}.${{ steps.phpversion.outputs.version_patch }},enable=true | |
- name: Build & Push - PHP-FPM bookworm FFmpeg | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
target: phpfpm-bookworm-ffmpeg | |
build-args: | | |
PHP_VERSION=${{ inputs.version || env.DEFAULT_VERSION }} | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta_bookworm_ffmpeg.outputs.tags }} | |
labels: ${{ steps.meta_bookworm_ffmpeg.outputs.labels }} |