Auto Sync #163
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Sync | |
on: | |
schedule: | |
- cron: '0 0 * * *' # At 00:00. https://crontab.guru/ | |
workflow_dispatch: # on button click | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # 'write' access to repository contents | |
steps: | |
- name: Install git-filter-repo | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git-filter-repo | |
- name: Checkout upstram | |
uses: actions/checkout@v2 | |
with: | |
repository: slidevjs/slidev | |
fetch-depth: 0 | |
- name: Extract docs | |
run: git filter-repo --subdirectory-filter docs --force | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: refs/heads/upstream |