Merge pull request #397 from boxuk/dependabot/docker/docker/database/… #374
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: Split Monorepo | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
jobs: | |
boxuk_packages_split: | |
# The following ensures this only occurs for the base skeleton repository. | |
if: "github.repository == 'boxuk/wp-project-skeleton'" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# define package to repository map (wp-content gets prefixed) | |
package: | |
- | |
local_path: 'mu-plugins/boxuk-base-wp-plugin' | |
split_repository: 'boxuk-base-wp-plugin' | |
steps: | |
- uses: actions/checkout@v3 | |
# no tag | |
- | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/[email protected]" | |
with: | |
package_directory: 'wp-content/${{ matrix.package.local_path }}' | |
repository_organization: 'boxuk' | |
repository_name: '${{ matrix.package.split_repository }}' | |
user_name: "boxuk" | |
user_email: "[email protected]" | |
# with tag | |
- | |
if: "startsWith(github.ref, 'refs/tags/')" | |
uses: "symplify/[email protected]" | |
with: | |
tag: ${GITHUB_REF#refs/tags/} | |
package_directory: 'wp-content/${{ matrix.package.local_path }}' | |
repository_organization: 'boxuk' | |
repository_name: '${{ matrix.package.split_repository }}' | |
user_name: "boxuk" | |
user_email: "[email protected]" | |
# The following is an example of how you can set up a monorepo split for your project. Either for shared plugins, or a shared theme, or both! | |
# | |
# project_packages_split: | |
# # The following ensures this only occurs for the given repository name. | |
# if: "github.repository == 'your-organisation-name/your-repository-name'" | |
# runs-on: ubuntu-latest | |
# | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# # define package to repository map (wp-content gets prefixed) | |
# package: | |
# - | |
# local_path: 'mu-plugins/your-shared-plugin' | |
# split_repository: 'repository-name-of-your-shared-plugin' | |
# - | |
# local_path: 'themes/your-theme' | |
# split_repository: 'repository-name-of-your-shared-theme' | |
# | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# # no tag | |
# - | |
# if: "!startsWith(github.ref, 'refs/tags/')" | |
# uses: "symplify/[email protected]" | |
# with: | |
# package_directory: 'wp-content/${{ matrix.package.local_path }}' | |
# repository_organization: 'your-organisation' | |
# repository_name: '${{ matrix.package.split_repository }}' | |
# user_name: "github-user-name" | |
# user_email: "github-email-address" | |
# | |
# # with tag | |
# - | |
# if: "startsWith(github.ref, 'refs/tags/')" | |
# uses: "symplify/[email protected]" | |
# with: | |
# tag: ${GITHUB_REF#refs/tags/} | |
# package_directory: 'wp-content/${{ matrix.package.local_path }}' | |
# repository_organization: 'your-organisation' | |
# repository_name: '${{ matrix.package.split_repository }}' | |
# user_name: "github-user-name" | |
# user_email: "github-email-address" |