Skip to content

开机时将上次运行时的日志文件重命名为log.txt.old #63

开机时将上次运行时的日志文件重命名为log.txt.old

开机时将上次运行时的日志文件重命名为log.txt.old #63

Workflow file for this run

name: Sync To Gitee
on:
workflow_dispatch:
push:
branches:
- 'main'
env:
SSH_PRIVATE_KEY: "${{ secrets.SSH_PRIVATE_KEY }}"
GIT_CLONE: "${{ github.workspace }}/git_clone"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y ssh git
- name: Sync to Gitee
run: |
mkdir -p ~/.ssh
echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
sudo chmod 0600 ~/.ssh/id_rsa
sudo chmod 0777 /etc/ssh/ssh_config
sudo echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
sudo chmod 0644 /etc/ssh/ssh_config
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
mkdir -vp ${GIT_CLONE}
git clone --mirror "[email protected]:chase535/accurate_battery.git" ${GIT_CLONE}
cd ${GIT_CLONE}
git remote set-url --push origin "[email protected]:chase535/accurate_battery"
git fetch -p origin
git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin
git push --mirror