split in different steps

This commit is contained in:
Pau Capó 2025-08-10 11:42:13 +02:00
parent 76b56114b5
commit 3f997f46aa

View file

@ -1,4 +1,4 @@
name: Weekly Docker Image Rebuild
name: Weekly Docker Image Build
on:
schedule:
@ -22,29 +22,57 @@ jobs:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push PHP images
- name: Setup Docker Buildx
run: |
PHP_VERSIONS="7.4 8.0 8.1 8.2"
PLATFORMS="linux/arm64/v8,linux/amd64"
docker buildx create --use --platform=linux/arm64/v8,linux/amd64 --name multi-platform-builder
docker buildx inspect --bootstrap
for PHP_VERSION in ${PHP_VERSIONS}; do
echo "Building php:${PHP_VERSION}"
- name: Build and push PHP 7.4
run: |
docker buildx build \
--no-cache \
--platform=${PLATFORMS} \
--platform=linux/arm64/v8,linux/amd64 \
--push \
-f "./Dockerfile-php" \
-t "git.paucapo.com/server/php:${PHP_VERSION}" \
--build-arg PHP_VERSION=${PHP_VERSION} \
-t "git.paucapo.com/server/php:7.4" \
--build-arg PHP_VERSION=7.4 \
.
done
docker buildx rm multi-platform-builder --force
- name: Build and push PHP 8.0
run: |
docker buildx build \
--no-cache \
--platform=linux/arm64/v8,linux/amd64 \
--push \
-f "./Dockerfile-php" \
-t "git.paucapo.com/server/php:8.0" \
--build-arg PHP_VERSION=8.0 \
.
- name: Build and push PHP 8.1
run: |
docker buildx build \
--no-cache \
--platform=linux/arm64/v8,linux/amd64 \
--push \
-f "./Dockerfile-php" \
-t "git.paucapo.com/server/php:8.1" \
--build-arg PHP_VERSION=8.1 \
.
- name: Build and push PHP 8.2
run: |
docker buildx build \
--no-cache \
--platform=linux/arm64/v8,linux/amd64 \
--push \
-f "./Dockerfile-php" \
-t "git.paucapo.com/server/php:8.2" \
--build-arg PHP_VERSION=8.2 \
.
- name: Cleanup
if: always()
run: |
docker buildx rm multi-platform-builder --force
docker image prune -a --force