Skip to content

Commit 18a21be

Browse files
committed
ci: automate validation and post-merge builds
1 parent a982efc commit 18a21be

File tree

3 files changed

+60
-23
lines changed

3 files changed

+60
-23
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
1-
name: Build
1+
name: Build And Publish Docs
22

33
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'dev/**'
9+
- 'images/**'
10+
- 'themes.json'
11+
- 'gulpfile.js'
12+
- 'gulpconfig.js'
13+
- 'package.json'
14+
- 'package-lock.json'
15+
- 'dev/config/**'
416
workflow_dispatch
517

18+
permissions:
19+
contents: write
20+
21+
concurrency:
22+
group: build-and-publish-${{ github.ref }}
23+
cancel-in-progress: true
24+
625
jobs:
726
build:
827
runs-on: ubuntu-latest
928
steps:
10-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
1130
with:
12-
persist-credentials: false
1331
fetch-depth: 0
14-
- uses: actions/setup-node@v1
32+
33+
- uses: actions/setup-node@v4
1534
with:
16-
node-version: 14
17-
- run: npm i
35+
node-version: 24
36+
cache: npm
37+
38+
- run: npm ci
39+
- run: npm test
1840
- run: npm run build
19-
- name: Commit files
41+
42+
- name: Commit generated docs
43+
shell: bash
2044
run: |
45+
if git diff --quiet -- docs; then
46+
echo "No generated docs changes to commit."
47+
exit 0
48+
fi
49+
2150
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
2251
git config --local user.name "github-actions[bot]"
23-
git add .
24-
git commit -m "ci(build): compile and deploy" -a
25-
- name: Push changes
26-
uses: ad-m/github-push-action@master
27-
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
branch: ${{ github.ref }}
52+
git add docs
53+
git commit -m "ci(build): compile and deploy"
54+
git push

.github/workflows/check-themes.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1-
name: Check themes.json
1+
name: Validate Site
22

33
on:
44
pull_request:
55
branches: [ main ]
66
paths:
7+
- 'dev/**'
8+
- 'images/**'
79
- 'themes.json'
10+
- 'gulpfile.js'
11+
- 'gulpconfig.js'
12+
- 'package.json'
13+
- 'package-lock.json'
14+
- 'dev/config/**'
15+
- '.github/workflows/**'
816

917
jobs:
10-
test_pull_requests:
18+
validate_pull_requests:
1119
runs-on: ubuntu-latest
1220
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v1
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-node@v4
1524
with:
16-
node-version: 14
17-
- run: npm i
25+
node-version: 24
26+
cache: npm
27+
28+
- run: npm ci
1829
- run: npm test
30+
- run: npm run build

MEMORY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ This file stores durable project context so future conversations can resume work
3030
- Existing GitHub Actions:
3131
- `.github/workflows/build.yml`
3232
- `.github/workflows/check-themes.yml`
33-
- Current workflows use older action versions and Node 14, which is a likely area for automation modernization
34-
- Build workflow is manual (`workflow_dispatch`) and commits generated `docs/` output back to the branch
35-
- PR validation currently runs only when `themes.json` changes
33+
- CI now uses current `actions/checkout@v4` and `actions/setup-node@v4` on Node 24
34+
- Build workflow now runs automatically on pushes to `main` that affect site/build inputs and commits regenerated `docs/` output back to the branch
35+
- PR validation now runs `npm test` and `npm run build` for site-related changes instead of only checking `themes.json`
3636

3737
## Repo Notes
3838

0 commit comments

Comments
 (0)