2024-04-03 16:47:34 +08:00
|
|
|
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: npm Install
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
- name: Generate
|
|
|
|
run: |
|
|
|
|
hexo clean
|
|
|
|
hexo generate
|
|
|
|
hexo deploy
|
2024-05-08 18:58:20 +08:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
personal_token: ${{ secrets.hexo }}
|
|
|
|
PUBLISH_BRANCH: gh-pages
|
|
|
|
PUBLISH_DIR: ./public
|
|
|
|
commit_message: ${{ github.event.head_commit.message }}
|