Sync Tutorials #1
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: Sync Tutorials | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # 每天运行一次 | |
jobs: | |
sync-tutorials: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Frontend Repo | |
uses: actions/checkout@v2 | |
with: | |
repository: 'WTFAcademy/frontend' | |
path: 'frontend' | |
- name: Sync WTF Ethers Tutorials | |
run: | | |
git clone https://github.com/WTFAcademy/WTF-Ethers.git | |
# copy first 9 chapters (with prefix 0) | |
cp -r WTF-Ethers/lectures/0{1..9}_* frontend/docs/ethers-101/ | |
# copy 10 chapter | |
cp -r WTF-Ethers/lectures/10_* frontend/docs/ethers-101/ | |
# delete WTF-Ethers | |
rm -rf WTF-Ethers | |
- name: Commit and Push Changes | |
run: | | |
cd frontend | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update tutorials" || echo "No changes to commit" | |
git push |