Skip to content

Build WP Test Runner image #1414

Build WP Test Runner image

Build WP Test Runner image #1414

name: Build WP Test Runner image
on:
schedule:
- cron: '45 10 * * *'
push:
branches:
- master
paths:
- "wp-test-runner/**"
- ".github/workflows/wp-test-runner.yml"
pull_request:
branches:
- master
paths:
- "wp-test-runner/**"
- ".github/workflows/wp-test-runner.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the source code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
- name: Login to DockerHub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name != 'pull_request' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
- name: Set up Docker Metadata
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
with:
images: ghcr.io/automattic/vip-container-images/wp-test-runner
tags: |
type=raw,value=latest
- name: Build and push
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
with:
context: wp-test-runner
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: CACHE_BUST=${{ github.run_id }}-${{ github.run_attempt }}
cache-from: type=gha,scope=wp-test-runner
cache-to: type=gha,mode=max,scope=wp-test-runner
no-cache: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}