备份 randpic #6
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: 备份 randpic | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 22 * * *' | |
permissions: | |
contents: write | |
deployments: write | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出仓库 | |
uses: actions/checkout@v4 | |
- name: 删除当前 randpic 文件夹 | |
run: | | |
rm -rf randpic | |
ls -la | |
- name: 下载新的备份 | |
run: python get.py | |
- name: 上传新备份 | |
if: steps.check.outputs.changed == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "[Actions] 自动同步" | |
git add . | |
git commit -m "Sync" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |