Blog/.github/workflows/deploy.yml
2022-03-22 10:45:58 +08:00

53 lines
1.4 KiB
YAML

name: Hexo Deploy
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: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 17
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install fonttools brotli requests
npm install -g hexo-cli
npm install
git config --global user.name "SouthFox-D"
git config --global user.email "southfoxdreamer@gmail.com"
- name: Deploy
env:
DEPLOY_KEY: ${{ secrets.HEXO_DEPLOY }}
DISCUSSIONS_TOKEN: ${{ secrets.DISCUSSIONS_TOKEN }}
run: |
hexo clean
hexo generate
python3 utils.py -d
pyftsubset Zpix.ttf --text-file=strdb.txt
fonttools ttLib.woff2 compress -o Zpix.woff2 Zpix.subset.ttf
mv Zpix.woff2 ./public/css/fonts
mv Zpix.subset.ttf ./public/css/fonts/Zpix.ttf
mv _headers ./public
cd ./public
git init
git add --all .
git commit -m "GitHub action Auto Builder"
git push --quiet --force https://$DEPLOY_KEY@github.com/SouthFox-D/SouthFox-D.github.io.git master