Skip to content

Commit 05ceb93

Browse files
committed
ci: Skip build for docs-only changes
Add paths-ignore to build-any-branch-with-all-dbs.yml so pushes and PRs touching only src/site/**, *.adoc, or *.md files skip the full compile/IT matrix (and thus also skip deploy-snapshot, which fires only on a successful build workflow_run). Add a direct push trigger on main with matching paths to publish-docs.yml so the site is still rebuilt and deployed when docs-only changes land on main without a build workflow run. Rewrite the build-site job condition to use negation (event_name != 'workflow_run') so all non-workflow_run triggers are covered without enumerating each one. Update the upload-pages-artifact step and deploy job conditions to explicitly allow the push event.
1 parent 0ba80c3 commit 05ceb93

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/build-any-branch-with-all-dbs.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: Build any branch with all databases
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'src/site/**'
7+
- '**/*.adoc'
8+
- '**/*.md'
9+
pull_request:
10+
paths-ignore:
11+
- 'src/site/**'
12+
- '**/*.adoc'
13+
- '**/*.md'
414

515
env:
616
MAVEN_COMMAND: ./mvnw

.github/workflows/publish-docs.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Build and Deploy Maven Site to GitHub Pages
22

33
on:
44
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
paths:
8+
- 'src/site/**'
9+
- '**/*.adoc'
10+
- '**/*.md'
511
workflow_run:
612
workflows: ["Build any branch with all databases", "Record Dependabot update in changes.xml"]
713
types: [completed]
@@ -22,7 +28,7 @@ env:
2228

2329
jobs:
2430
build-site:
25-
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
31+
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
2632
runs-on: ubuntu-latest
2733
timeout-minutes: 20
2834
steps:
@@ -33,14 +39,20 @@ jobs:
3339
- name: Generate Maven site
3440
run: ${{ env.MAVEN_COMMAND }} ${{ env.MAVEN_CLI_COMMON }} site -Dproject.build.outputTimestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
3541
- name: Upload Pages artifact
36-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'
42+
if: >-
43+
github.event_name == 'workflow_dispatch' ||
44+
github.event_name == 'push' ||
45+
github.event_name == 'workflow_run'
3746
uses: actions/upload-pages-artifact@v5
3847
with:
3948
path: target/site/
4049

4150
deploy:
4251
needs: build-site
43-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'
52+
if: >-
53+
github.event_name == 'workflow_dispatch' ||
54+
github.event_name == 'push' ||
55+
github.event_name == 'workflow_run'
4456
runs-on: ubuntu-latest
4557
timeout-minutes: 10
4658
environment:

0 commit comments

Comments
 (0)