Skip to content

29.0.4

29.0.4 #49

Workflow file for this run

name: Docker
on:
push:
branches-ignore: [ "*" ]
# Publish semver tags as releases.
tags: [ '*' ]
env:
# Web server application name
APP_NAME: apache
jobs:
build:
services:
registry:
image: registry:2
ports:
- 5000:5000
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Nextcloud version check
id: vercheck-nextcloud
run: |
sed -e "s/\(\([0-9]*\)\..*\)/version=\1\nmversion=\2/p" \
-e d \
nextcloud/latest.txt >> $GITHUB_OUTPUT
shell: bash
- name: PHP version check
id: vercheck-php
run: |
sed -e "s/^FROM php:\(.*\)-\(.*\)-\(.*\)/version=\1\napp=\2\ndebian=\3/p" \
-e d \
nextcloud/${{ steps.vercheck-nextcloud.outputs.mversion }}/$APP_NAME/Dockerfile >> $GITHUB_OUTPUT
shell: bash
- name: PHP Dockerfile modify
id: modify-php
run: |
sed -i \
-e "s/\(--with-apxs2\)/\1 --enable-zts --disable-zend-signals --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-bz2/g" \
-e "s/\(zlib1g-dev\)/\1 libbz2-dev/g" \
-e "s/\(gnupg\)/\1 aria2/g" \
-e "s/curl -fsSL/aria2c -x8/g" \
php/${{ steps.vercheck-php.outputs.version }}/${{ steps.vercheck-php.outputs.debian }}/${{ steps.vercheck-php.outputs.app }}/Dockerfile
shell: bash
- name: Build PHP Docker local image
id: build-php
uses: docker/build-push-action@v5
with:
context: ./php/${{ steps.vercheck-php.outputs.version }}/${{ steps.vercheck-php.outputs.debian }}/${{ steps.vercheck-php.outputs.app }}
push: true
tags: localhost:5000/${{ github.repository_owner }}/local-php:${{ steps.vercheck-php.outputs.version }}-${{ steps.vercheck-php.outputs.app }}-zts-${{ steps.vercheck-php.outputs.debian }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Nextcloud Dockerfile modify
id: modify-nextcloud
run: |
sed -i -e "s!FROM .*!FROM localhost:5000/whitehara/local-php:${{ steps.vercheck-php.outputs.version }}-${{ steps.vercheck-php.outputs.app }}-zts-${{ steps.vercheck-php.outputs.debian }}!g" \
-e "s/\(gnupg\)/\1 aria2/g" \
-e "s/curl -fsSL/aria2c -x8/g" \
nextcloud/${{ steps.vercheck-nextcloud.outputs.mversion }}/${{ steps.vercheck-php.outputs.app }}/Dockerfile
shell: bash
- name: Build Nextcloud Docker image
id: build-nextcloud
uses: docker/build-push-action@v5
with:
context: ./nextcloud/${{ steps.vercheck-nextcloud.outputs.mversion }}/${{ steps.vercheck-php.outputs.app }}
push: true
tags: localhost:5000/${{ github.repository_owner }}/local-nextcloud:${{ steps.vercheck-nextcloud.outputs.mversion }}-${{ steps.vercheck-php.outputs.app }}-zts
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Nextcloud-custom Dockerfile modify
id: modify-nextcloud-custom
run: |
sed -i -e "s!FROM .*!FROM localhost:5000/${{ github.repository_owner }}/local-nextcloud:${{ steps.vercheck-nextcloud.outputs.mversion }}-${{ steps.vercheck-php.outputs.app }}-zts!g" \
./Dockerfile
shell: bash
- name: Docker Nextcloud-custom meta
id: meta-nextcloud-custom
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
tags: |
type=semver,pattern={{version}},value=${{ steps.vercheck-nextcloud.outputs.version }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-nextcloud-custom.outputs.tags }}
labels: ${{ steps.meta-nextcloud-custom.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max