forked from joshbuchea/HEAD
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1001 Bytes
/
sync-readme.yml
File metadata and controls
49 lines (39 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Sync README to gh-pages
on:
push:
branches:
- master
paths:
- README.md
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Save README from master
run: cp README.md /tmp/README.md
- name: Checkout gh-pages
run: |
git fetch origin gh-pages
git checkout gh-pages
- name: Replace README
run: |
cp /tmp/README.md README.md
- name: Commit if changed
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
if git diff --quiet README.md; then
echo "No changes to commit"
exit 0
fi
git add README.md
git commit -m "Sync README from master"
git push origin gh-pages