Skip to content

Commit 59e92fa

Browse files
authored
Merge pull request #36 from versatica/docs-ci-check-if-version-changed
2 parents 51803ab + 936f9db commit 59e92fa

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/docs.yaml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
name: Deploy static docs to Pages
33

44
on:
5-
release:
6-
types: [published]
5+
push:
6+
branches: [master]
77
# Allows you to run this workflow manually from the Actions tab.
88
workflow_dispatch:
99

@@ -38,17 +38,29 @@ jobs:
3838
with:
3939
node-version: 22
4040

41-
- name: npm ci
42-
run: npm ci --foreground-scripts
41+
- name: Check if version has been updated
42+
id: check
43+
uses: EndBug/version-check@v2
4344

44-
- name: npm run docs
45-
run: npm run docs
45+
- name: Log when version has changed
46+
if: steps.check.outputs.changed == 'true'
47+
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
4648

47-
- name: Upload artifact
48-
uses: actions/upload-pages-artifact@v3
49-
with:
50-
path: docs/
49+
- name: Log when version has not changed
50+
if: steps.check.outputs.changed == 'false'
51+
run: 'echo "No version change"'
52+
53+
# - name: npm ci
54+
# run: npm ci --foreground-scripts
55+
56+
# - name: npm run docs
57+
# run: npm run docs
58+
59+
# - name: Upload artifact
60+
# uses: actions/upload-pages-artifact@v3
61+
# with:
62+
# path: docs/
5163

52-
- name: Deploy to GitHub Pages
53-
id: deployment
54-
uses: actions/deploy-pages@v4
64+
# - name: Deploy to GitHub Pages
65+
# id: deployment
66+
# uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)