Skip to content

CI/CD

CI/CD #122

Workflow file for this run

name: CI/CD
on:
push:
workflow_dispatch:
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '8.0', '8.1', '8.2', '8.3' ]
type: [ '', '-prod' ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export to Docker (nginx)
uses: docker/build-push-action@v3
with:
context: ${{ matrix.version }}-nginx${{ matrix.type }}
load: true
tags: kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}
- name: Test docker images PHP executable
run: |
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} php -v
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} wp --allow-root --version
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} nginx -v
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} supervisord version
- name: Test docker images wordpress code
run: |
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} php /kool/wordpress/index.php
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Hub
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
run: |
docker push kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}
- name: Build and push (nginx)
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
with:
context: ${{ matrix.version }}-nginx${{ matrix.type }}
platforms: linux/amd64,linux/arm64
push: true
tags: kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}