E5-Rclone-Actions-Repo #410
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: E5-Rclone-Actions-Repo | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: 30 13 * * * | |
watch: | |
types: started | |
jobs: | |
run-it: | |
runs-on: ubuntu-latest | |
name: zip | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v2 | |
- name: Install rclone #安装rclone | |
run: curl https://rclone.org/install.sh | sudo bash | |
- name: Unzip config #解压配置文件 | |
run: | | |
mkdir -p ~/.config/rclone/ | |
unzip -P ${{ secrets.PASSWD }} rclone.zip -d ~/.config/rclone/ | |
- name: Run rclone #运行rclone | |
run: | | |
# 更改时区 | |
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
# 列出文件(此处不展示) | |
echo "列出文件(此处不展示)" | |
rclone lsd e5:/ > "lsd.log" | |
rclone mkdir e5:/E5-Rclone-Actions-Repo/ | |
rclone move lsd.log e5:/E5-Rclone-Actions-Repo/ | |
rclone delete e5:/E5-Rclone-Actions-Repo/lsd.log | |
rclone rmdir e5:/E5-Rclone-Actions-Repo/ | |
- name: Zip config #打包配置文件 | |
run: zip -P ${{ secrets.PASSWD }} rclone.zip -j ~/.config/rclone/rclone.conf | |
- name: Commit config #提交配置文件 | |
run: | | |
git config --global user.email "null@null.null" | |
git config --global user.name "null" | |
git add . | |
git commit -am "Auto update rclone config" | |
git push |