add weekly build, change to trixie and clean up

This commit is contained in:
Pau Capó 2025-08-10 11:07:45 +02:00
parent 15adccd03c
commit 76b56114b5
3 changed files with 52 additions and 15 deletions

View file

@ -0,0 +1,50 @@
name: Weekly Docker Image Rebuild
on:
schedule:
- cron: '0 2 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: git.paucapo.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push PHP images
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}"
docker buildx build \
--no-cache \
--platform=${PLATFORMS} \
--push \
-f "./Dockerfile-php" \
-t "git.paucapo.com/server/php:${PHP_VERSION}" \
--build-arg PHP_VERSION=${PHP_VERSION} \
.
done
docker buildx rm multi-platform-builder --force
- name: Cleanup
if: always()
run: |
docker image prune -a --force