Adjust paths for MD-CMS multisite workflow

Updated paths and git commands for multisite configuration in the workflow.
This commit is contained in:
Kristian Benestad 2026-05-18 17:00:16 +07:00 committed by GitHub
parent c7ddf32720
commit 9ea0c0cc55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,7 +56,7 @@ jobs:
git push git push
``` ```
If your MD-CMS instance is served from a directory within the repository (e.g., `docs`), you need to adjust the following paths accordingly: If your MD-CMS instance is served from a directory within the repository (e.g., `docs`), you need to adjust `paths` and `git add` accordingly:
```bash ```bash
paths: paths:
@ -65,12 +65,18 @@ If your MD-CMS instance is served from a directory within the repository (e.g.,
- "[PATH TO SITE]/config.yml" - "[PATH TO SITE]/config.yml"
``` ```
and
```bash
git add [PATH TO SITE]/nav.yml [PATH TO SITE]/search.json
```
## Enable workflow on multisites ## Enable workflow on multisites
If you serve multiple MD-CMS instances from the same repository, you need to use a customised version of the script. If you serve multiple MD-CMS instances from the same repository, you need to use a customised version of the script.
Create `.github/workflows/build.yml` in your repository. Create `.github/workflows/build.yml` in your repository.
Review the script below. It has been set up with four different directories (`DIRECTORY`, `DIRECTORY2`, `DIRECTORY3`, and `DIRECTORY4`). Change the paths to your own directories: Review the script below. It has been set up with four different directories (`DIRECTORY`, `DIRECTORY2`, `DIRECTORY3`, and `DIRECTORY4`). Change `paths` and `for section in` to your own directories:
```bash ```bash
name: Build name: Build
@ -120,7 +126,7 @@ jobs:
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
for section in docs legal learning reception sysadmin; do for section in [DIRECTORY2] [DIRECTORY2] [DIRECTORY3] [DIRECTORY4]; do
git add $section/nav.yml $section/search.json git add $section/nav.yml $section/search.json
done done
git diff --staged --quiet || git commit -m "Build: update nav.yml and search.json" git diff --staged --quiet || git commit -m "Build: update nav.yml and search.json"
@ -128,4 +134,5 @@ jobs:
``` ```
This is different from the single site workflow. If you move from single site to multisite you need to updated the entire script -- it is not sufficient to just list the paths! This is different from the single site workflow. If you move from single site to multisite you need to updated the entire script -- it is not sufficient to just list the paths!