Skip to content

only when base changes #42

only when base changes

only when base changes #42

name: Build and Push Docker image
env:
PHP_VERSION: 8.3
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 1'
jobs:
build:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Docker Image Update Checker
id: baseupdatecheck
uses: lucacome/docker-image-update-checker@v1
with:
base-image: library/wordpress:php${{ env.PHP_VERSION }}-fpm-alpine
image: hueske-digital/wordpress
- name: Checkout code
uses: actions/checkout@v4
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Login to GitLab Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
context: ./build
tags: ghcr.io/hueske-digital/wordpress:latest
platforms: linux/amd64,linux/arm64
build-args: |
PHP_VERSION=${{ env.PHP_VERSION }}
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Do not automatically disable workflow execution
uses: gautamkrishnar/keepalive-workflow@v1