40 lines (35 loc) · 972 Bytes
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: build
on:
push:
branches:
- blog-source
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.12.1]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install -g hexo-cli
npm install
- name: Hexo generate
run: |
hexo clean && hexo generate
- name: Hexo deploy
env:
GH_TOKEN: ${{secrets.ACCESS_TOKEN}}
run: |
cd ./public
git init
git config user.name "Jenly"
git config user.email "jenly1314@gmail.com"
git add .
git commit -a -m "Auto deploy by CI."
git push --force --quiet "https://${GH_TOKEN}@github.com/jenly1314/jenly1314.github.io.git" master:master