Optimize #131
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker image | |
env: | |
PHP_VERSION: 8.3 | |
OWN_IMAGE: ghcr.io/hueske-digital/wordpress:latest | |
NGINX_IMAGE: ghcr.io/hueske-digital/wordpress:nginx | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
build: | |
permissions: | |
contents: write | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download NGINX Dockerfile | |
run: curl -o ./build/Dockerfile-Web https://raw.githubusercontent.com/nginxinc/docker-nginx-unprivileged/main/mainline/alpine/Dockerfile | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push NGINX Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: ./build | |
file: ./build/Dockerfile-Web | |
tags: ${{ env.NGINX_IMAGE }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
UID=1000 | |
GID=1000 | |
- name: Build and push WordPress Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: ./build | |
file: ./build/Dockerfile | |
tags: ${{ env.OWN_IMAGE }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
PHP_VERSION=${{ env.PHP_VERSION }} | |
- name: Do not automatically disable workflow execution | |
uses: gautamkrishnar/keepalive-workflow@v1 |