Skip to content

Merge pull request #1420 from Automattic/update/actions #1785

Merge pull request #1420 from Automattic/update/actions

Merge pull request #1420 from Automattic/update/actions #1785

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@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Login to DockerHub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # 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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Set up Docker Metadata
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # 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@263435318d21b8e681c14492fe198d362a7d2c83 # 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' }}