From 06b97bbf4db500ee05866a947268cf56265da6e6 Mon Sep 17 00:00:00 2001 From: "dave@tiredofit.ca" Date: Fri, 8 Dec 2023 08:47:58 -0800 Subject: [PATCH] Release 7.7.4 - See CHANGELOG.md --- .github/workflows/main.yml | 6 +- .github/workflows/manual.yml | 6210 ++++++++++++++------------- CHANGELOG.md | 6 + README.md | 6 +- install/assets/functions/20-php-fpm | 3 + 5 files changed, 3244 insertions(+), 2987 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da57a54..815f62f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: php83_alpine: env: DISTRO: "alpine" - DISTRO_VARIANT: "edge" + DISTRO_VARIANT: "3.19" PHP_BASE: 8.3 build_file: Dockerfile runs-on: ubuntu-latest @@ -138,7 +138,7 @@ jobs: php82_alpine: env: DISTRO: "alpine" - DISTRO_VARIANT: "3.18" + DISTRO_VARIANT: "3.19" PHP_BASE: 8.2 build_file: Dockerfile runs-on: ubuntu-latest @@ -262,7 +262,7 @@ jobs: php81_alpine: env: DISTRO: "alpine" - DISTRO_VARIANT: "3.18" + DISTRO_VARIANT: "3.19" PHP_BASE: 8.1 build_file: Dockerfile runs-on: ubuntu-latest diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 61769b9..80576bc 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -10,2984 +10,3232 @@ on: description: 'Manual Build' required: false jobs: - php82_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.18" - PHP_BASE: 8.2 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php81_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.18" - PHP_BASE: 8.1 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php80_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.16" - PHP_BASE: 8.0 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - - php74_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.15" - PHP_BASE: 7.4 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - - php73_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.12" - PHP_BASE: 7.3 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - - php72_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.9" - PHP_BASE: 7.2 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - - php71_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.7" - PHP_BASE: 7.1 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php70_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.5" - PHP_BASE: 7.0 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php56_alpine: - env: - DISTRO: "alpine" - DISTRO_VARIANT: "3.5" - PHP_BASE: 5.6 - build_file: Dockerfile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php82_debian_bookworm: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bookworm" - PHP_BASE: 8.2 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - php82_debian_bullseye: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 8.2 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php82_debian_buster: - env: - DISTRO: "debian" - DISTRO_VARIANT: "buster" - PHP_BASE: 8.2 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php81_debian_bookworm: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bookworm" - PHP_BASE: 8.1 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php81_debian_bullseye: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 8.1 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php81_debian_buster: - env: - DISTRO: "debian" - DISTRO_VARIANT: "buster" - PHP_BASE: 8.1 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php80_debian_bookworm: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bookworm" - PHP_BASE: "8.0" - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php80_debian_bullseye: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: "8.0" - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php80_debian_buster: - env: - DISTRO: "debian" - DISTRO_VARIANT: "buster" - PHP_BASE: "8.0" - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php74_debian_bookworm: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bookworm" - PHP_BASE: 7.4 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php74_debian_bullseye: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 7.4 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php74_debian_buster: - env: - DISTRO: "debian" - DISTRO_VARIANT: "buster" - PHP_BASE: 7.4 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php73_debian_bookworm: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bookworm" - PHP_BASE: 7.3 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php73_debian_bullseye: - env: - DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 7.3 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### - php73_debian_buster: - env: - DISTRO: "debian" - DISTRO_VARIANT: "buster" - PHP_BASE: 7.3 - build_file: Dockerfile.debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prep - run: | - if [[ "${GITHUB_REF}" == refs/heads/* ]]; then - if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then - git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" - else - git_branch=${GITHUB_REF#refs/heads/} - fi - - case "${git_branch}" in - "main" | "master" ) - if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then - image_latest=",${GITHUB_REPOSITORY}:latest" - fi - if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then - image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" - fi - branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" - ;; - "develop" ) - branch_tag="${GITHUB_REPOSITORY}:develop" - ;; - esac - fi - - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" - fi - - if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then - image_tags=${branch_tag},${git_tag} - else - image_tags="${branch_tag}${git_tag}" - fi - - echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV - dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") - ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") - echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT - - name: Label - id: Label - run: | - image_name=${GITHUB_REPOSITORY/docker-/} - if [ -f "${{ env.build_file }}" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} - sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} - - if [ -f "CHANGELOG.md" ] ; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} - mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md - fi - - if [[ $GITHUB_REF == refs/tags/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} - fi - - if [[ $GITHUB_REF == refs/heads/* ]]; then - sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} - fi - fi - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm,arm64 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./${{ env.build_file }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: ${{ steps.prep.outputs.container_images }} - build-args: | - DISTRO=${{ env.DISTRO }} - DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} - PHP_BASE=${{ env.PHP_BASE }} - - - name: Update Docker Hub Information - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ env.dockerhub_repo }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./README.md - ### + php83_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.19" + PHP_BASE: 8.3 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php82_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.19" + PHP_BASE: 8.2 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php81_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.19" + PHP_BASE: 8.1 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php80_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.16" + PHP_BASE: 8.0 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + + php74_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.15" + PHP_BASE: 7.4 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + + php73_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.12" + PHP_BASE: 7.3 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + + php72_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.9" + PHP_BASE: 7.2 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + + php71_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.7" + PHP_BASE: 7.1 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php70_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.5" + PHP_BASE: 7.0 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php56_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.5" + PHP_BASE: 5.6 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_ALPINE }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php83_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php82_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.2 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md + php82_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 8.2 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php82_debian_buster: + env: + DISTRO: "debian" + DISTRO_VARIANT: "buster" + PHP_BASE: 8.2 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php81_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.1 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php81_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 8.1 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php81_debian_buster: + env: + DISTRO: "debian" + DISTRO_VARIANT: "buster" + PHP_BASE: 8.1 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php80_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: "8.0" + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php80_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: "8.0" + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php80_debian_buster: + env: + DISTRO: "debian" + DISTRO_VARIANT: "buster" + PHP_BASE: "8.0" + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 7.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_buster: + env: + DISTRO: "debian" + DISTRO_VARIANT: "buster" + PHP_BASE: 7.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php73_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php73_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 7.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php73_debian_buster: + env: + DISTRO: "debian" + DISTRO_VARIANT: "buster" + PHP_BASE: 7.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### diff --git a/CHANGELOG.md b/CHANGELOG.md index 4295e54..6ba3a49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.7.4 2023-12-08 + + ### Changed + - Add alpine:3.19 + + ## 7.7.3 2023-12-05 ### Changed diff --git a/README.md b/README.md index 980b10f..61899fb 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ The following image tags are available along with their tagged release based on | PHP version | Alpine Base | Tag | Debian Base | Tag | | ----------- | ----------- | -------------- | ----------- | ---------------------- | | latest | edge | `:alpine-edge` | | | -| 8.3.x | edge | `:8.3-alpine` | Bookworm | `:8.3-debian-bookworm` | -| 8.2.x | 3.18 | `:8.2-alpine` | Bookworm | `:8.2-debian-bookworm` | -| 8.1.x | 3.18 | `:8.1-alpine` | Bookworm | `:8.1-debian-bookworm` | +| 8.3.x | 3.19 | `:8.3-alpine` | Bookworm | `:8.3-debian-bookworm` | +| 8.2.x | 3.19 | `:8.2-alpine` | Bookworm | `:8.2-debian-bookworm` | +| 8.1.x | 3.19 | `:8.1-alpine` | Bookworm | `:8.1-debian-bookworm` | | 8.0.x | 3.16 | `:8.0-alpine` | Bookworm | `:8.0-debian-bookworm` | | 7.4.x | 3.15 | `:7.4-alpine` | Bookworm | `:7.4-debian-bookworm` | | 7.3.x | 3.12 | `:7.3-alpine` | Bookworm | `:7.3-debian-bookworm` | diff --git a/install/assets/functions/20-php-fpm b/install/assets/functions/20-php-fpm index bc65b67..4ef7664 100755 --- a/install/assets/functions/20-php-fpm +++ b/install/assets/functions/20-php-fpm @@ -11,6 +11,9 @@ phpfpm_bootstrap() { 8.2 ) php_prefix="/etc/php82/" ;; + 8.3 ) + php_prefix="/etc/php83/" + ;; * ) php_prefix="/etc/php$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1)/" ;;