Skip to content

Merge pull request #49 from Vikutorika/master #43

Merge pull request #49 from Vikutorika/master

Merge pull request #49 from Vikutorika/master #43

Workflow file for this run

name: docs
on:
push:
branches:
- master
env:
TZ: Asia/Shanghai
# 任务
jobs:
build-and-deploy:
# 服务器环境:最新版 Ubuntu
runs-on: ubuntu-latest
steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Cache node modules
id: node-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Install Dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm install
# 生成静态文件
- name: Generate pages
run: |
npm i hexo-cli -g
hexo g
# 部署到 GitHub Pages
- name: Deploy site
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
token: ${{ secrets.GH_TOKEN }}
repository-name: ${{ secrets.GH_REPO}}
branch: gh-pages
folder: public
commit-message: ${{ github.event.head_commit.message }}
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'