2022-03-16 15:24:24 +01:00
|
|
|
name: Backup Blog Img
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ hexo ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.9
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get install wget
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip install fonttools brotli requests
|
|
|
|
git config --global user.name "SouthFox-D"
|
|
|
|
git config --global user.email "southfoxdreamer@gmail.com"
|
|
|
|
|
|
|
|
- name: Check Img
|
|
|
|
run: |
|
|
|
|
wget https://raw.githubusercontent.com/SouthFox-D/blog_img/main/imgList.json
|
|
|
|
python3 utils.py -b
|
|
|
|
|
|
|
|
- name: Backup
|
|
|
|
env:
|
|
|
|
DEPLOY_KEY: ${{ secrets.HEXO_DEPLOY }}
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/SouthFox-D/blog_img.git blog_img
|
2022-04-04 17:59:39 +02:00
|
|
|
cp -f newimg/* blog_img
|
2022-03-16 15:24:24 +01:00
|
|
|
cd blog_img
|
|
|
|
git add .
|
2022-04-04 17:53:11 +02:00
|
|
|
git commit -m "Auto backup" || echo "Nothing to push"
|
2022-03-16 15:24:24 +01:00
|
|
|
git push --force https://$DEPLOY_KEY@github.com/SouthFox-D/blog_img.git
|
|
|
|
|