mirror of
https://github.com/kbenestad/mdcms.git
synced 2026-06-18 15:24:32 +00:00
Enhance GitHub Actions workflow and permissions
Updated GitHub Actions workflow to include permissions and modified installation command for mdcms. Changed directory handling for building sections to use a loop instead of hardcoded values.
This commit is contained in:
parent
3858307302
commit
c7ddf32720
1 changed files with 10 additions and 9 deletions
|
|
@ -32,6 +32,8 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -94,6 +96,8 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -102,11 +106,11 @@ jobs:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: Install mdcms
|
- name: Install mdcms
|
||||||
run: pip install mdcms
|
run: pip install git+https://github.com/kbenestad/mdcms.git
|
||||||
|
|
||||||
- name: Build all sections
|
- name: Build all sections
|
||||||
run: |
|
run: |
|
||||||
for section in [DIRECTORY1] [DIRECTORY2] [DIRECTORY3] [DIRECTORY4]; do
|
for section in docs legal learning reception sysadmin; do
|
||||||
cd $section
|
cd $section
|
||||||
mdcms build
|
mdcms build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
@ -116,15 +120,12 @@ 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"
|
||||||
git add docs/nav.yml docs/search.json legal/nav.yml legal/search.json learning/nav.yml learning/search.json sysadmin/nav.yml sysadmin/search.json
|
for section in docs legal learning reception sysadmin; do
|
||||||
|
git add $section/nav.yml $section/search.json
|
||||||
|
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"
|
||||||
git push
|
git push
|
||||||
```
|
```
|
||||||
|
|
||||||
**IMPORTANT:** Please take note of the `run` part, where each directory is listed:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
for section in [DIRECTORY1] [DIRECTORY2] [DIRECTORY3] [DIRECTORY4]; do
|
|
||||||
```
|
|
||||||
|
|
||||||
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!
|
||||||
Loading…
Reference in a new issue