mirror of https://github.com/jkjoy/sunpeiwen.git
59 lines
1.1 KiB
YAML
59 lines
1.1 KiB
YAML
|
run-name: Deploy
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- main
|
||
|
|
||
|
release:
|
||
|
types:
|
||
|
- published
|
||
|
|
||
|
workflow_dispatch:
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
with:
|
||
|
ref: main
|
||
|
|
||
|
- name: Setup Node
|
||
|
uses: actions/setup-node@v1
|
||
|
with:
|
||
|
node-version: "18.x"
|
||
|
|
||
|
- name: Install Hexo
|
||
|
run: |
|
||
|
npm install hexo-cli -g
|
||
|
|
||
|
- name: Cache Modules
|
||
|
uses: actions/cache@v1
|
||
|
id: cache-modules
|
||
|
with:
|
||
|
path: node_modules
|
||
|
key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}}
|
||
|
|
||
|
- name: Install Dependencies
|
||
|
if: steps.cache-modules.outputs.cache-hit != 'true'
|
||
|
run: |
|
||
|
npm install
|
||
|
- name: npm Install
|
||
|
run: |
|
||
|
npm install
|
||
|
- name: Generate
|
||
|
run: |
|
||
|
hexo clean
|
||
|
hexo generate
|
||
|
hexo douban
|
||
|
- name: Deploy
|
||
|
run: |
|
||
|
git config --global user.name "jkjoy"
|
||
|
git config --global user.email "jkjoy@live.cn"
|
||
|
git clone https://github.com/jkjoy/blog.git .deploy_git
|
||
|
export TZ='Asia/Shanghai'
|
||
|
hexo deploy
|