forked from ferronweb/ferron
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.59 KB
/
sync-website-v2.yml
File metadata and controls
56 lines (48 loc) · 1.59 KB
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
50
51
52
53
54
55
56
name: Sync with Ferron website (Ferron 2.x)
on:
push:
branches: ["2.x"]
paths:
- "docs/**"
- "CHANGELOG.md"
- ".github/workflows/sync-website-v2.yml"
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: 2.x
path: ferron
- name: Checkout Ferron website
uses: actions/checkout@v6
with:
repository: ferronweb/ferron.sh
token: ${{ secrets.GIT_TOKEN }}
ref: main
path: website
- name: Sync website
run: |
rm -rf website/docs/index
cp -r ferron/docs website/docs/index
cat << EOF > website/docs/index/README.md
# Ferron documentation
This Ferron documentation is automatically synchronized with https://github.com/ferronweb/ferron/tree/2.x.
If you want to contribute to the documentation, please open a pull request on the Ferron repository, not on the website repository.
EOF
cat << EOF > website/changelogs/index.md
---
subject: Ferron 2
---
EOF
cat ferron/CHANGELOG.md | grep -vE '^# ' >> website/changelogs/index.md
cd website
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m 'chore: sync from https://github.com/ferronweb/ferron/tree/2.x'
git push origin main