Merge pull request #92 from SouthFox-D/dependabot/npm_and_yarn/ejs-3.… #172
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: 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 "[email protected]" | |
- 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 | |
cp -f newimg/* blog_img | |
cd blog_img | |
git add . | |
git commit -m "Auto backup" || echo "Nothing to push" | |
git push --force https://[email protected]/SouthFox-D/blog_img.git | |