Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 7e34180

Browse files
committed
ci: only update doc when doc related files changed
1 parent 19044fd commit 7e34180

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ jobs:
121121
- name: Checkout repository
122122
uses: actions/checkout@v3
123123

124-
- name: Setup repository
125-
uses: ./.github/actions/setup
126-
127124
- name: Check version bump
128125
id: check_version_bump
129126
uses: mathieudutour/[email protected]
@@ -132,14 +129,27 @@ jobs:
132129
default_bump: false
133130
dry_run: true
134131

135-
- name: Build package documentation
132+
- name: Check change in documentation
133+
id: changed_doc
136134
if: steps.check_version_bump.outputs.release_type == ''
135+
uses: tj-actions/[email protected]
136+
with:
137+
files: |
138+
Sources/**/*
139+
Package*.swift
140+
141+
- name: Setup repository
142+
if: steps.changed_doc.outputs.any_changed == 'true'
143+
uses: ./.github/actions/setup
144+
145+
- name: Build package documentation
146+
if: steps.changed_doc.outputs.any_changed == 'true'
137147
run: |
138148
npm run build
139149
npm run serve-doc
140150
141151
- name: Update GitHub Pages
142-
if: steps.check_version_bump.outputs.release_type == ''
152+
if: steps.changed_doc.outputs.any_changed == 'true'
143153
uses: JamesIves/[email protected]
144154
with:
145155
branch: gh-pages

0 commit comments

Comments
 (0)