Skip to content

Commit 4ab9488

Browse files
authored
ci: add sync CI
See #86 (comment)
1 parent cccdb99 commit 4ab9488

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/sync.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Auto Sync
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # At 00:00. https://crontab.guru/
6+
workflow_dispatch: # on button click
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # 'write' access to repository contents
13+
steps:
14+
- name: Install git-filter-repo
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y git-filter-repo
18+
19+
- name: Checkout upstram
20+
uses: actions/checkout@v2
21+
with:
22+
repository: slidevjs/slidev
23+
fetch-depth: 0
24+
25+
- name: Extract docs
26+
run: git filter-repo --subdirectory-filter docs --force
27+
28+
- name: Push changes
29+
uses: ad-m/github-push-action@v0.8.0
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
branch: refs/heads/upstream

0 commit comments

Comments
 (0)