Skip to content

Commit

Permalink
ci: refactor wordpress.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Oct 31, 2023
1 parent bfe7f3c commit 159b7f8
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/wordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ on:
paths:
- "wordpress/**"
- ".github/workflows/wordpress.yml"
- ".github/actions/build-docker-image/**"
pull_request:
paths:
- "wordpress/**"
- ".github/workflows/wordpress.yml"
- ".github/actions/build-docker-image/**"
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -44,6 +46,7 @@ jobs:
permissions:
contents: read
packages: write
pull-requests: write
strategy:
fail-fast: false
matrix:
Expand All @@ -61,30 +64,17 @@ jobs:
echo "tags=" >> $GITHUB_OUTPUT
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
if: ${{ github.base_ref == null }}
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build WordPress image
uses: docker/build-push-action@v5
- name: Build and push image
uses: ./.github/actions/build-docker-image
with:
platforms: linux/amd64,linux/arm64
context: wordpress
push: ${{ github.base_ref == null }}
build-args: WP_GIT_REF=${{ matrix.wp.ref }}
args: WP_GIT_REF=${{ matrix.wp.ref }}
cache-from: type=gha,scope=wordpress-${{ matrix.wp.ref }}
cache-to: type=gha,mode=max,scope=wordpress-${{ matrix.wp.ref }}
no-cache: ${{ matrix.wp.cacheable == false }}
tags: |
ghcr.io/automattic/vip-container-images/wordpress:${{ matrix.wp.tag }}
${{ steps.extra-tags.outputs.tags }}
primaryTag: ghcr.io/automattic/vip-container-images/wordpress:${{ matrix.wp.tag }}
tags: ${{ steps.extra-tags.outputs.tags }}
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 159b7f8

Please sign in to comment.