Skip to content

Commit bbf9a3d

Browse files
committed
Add action to sync documentation to the website
1 parent 500c68b commit bbf9a3d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/syncpages.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync doc changes
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
sync-docs:
12+
name: Sync content from master to pages
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
submodules: false
19+
fetch-depth: 0 # Necessary to get both the master and pages branches
20+
fetch-tags: false
21+
ref: pages
22+
23+
- name: Commit and push, if docs have changed
24+
run: |
25+
if git diff origin/master -- ./doc ./AUTHORS.md ./LICENCE.md ./SECURITY.md \
26+
./README ./NON-AUTOTOOLS-BUILD >/dev/null ; then
27+
# Differences from master: merge and push
28+
git config user.name "github-actions[bot]"
29+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
30+
git merge origin/master --no-edit -m"Sync content from master to pages"
31+
git push
32+
else
33+
echo "No content changes to sync"
34+
fi

0 commit comments

Comments
 (0)