2022-03-16 15:24:24 +01:00
|
|
|
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
|
2022-03-22 03:45:58 +01:00
|
|
|
mv _headers ./public
|
2022-03-16 15:24:24 +01:00
|
|
|
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
|
|
|
|
|