50 lines
No EOL
1.4 KiB
YAML
50 lines
No EOL
1.4 KiB
YAML
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 |