Hexo-Theme-Acrylic icon indicating copy to clipboard operation
Hexo-Theme-Acrylic copied to clipboard

使用Github Action自动部署渲染报错no layout

Open bladedevoff opened this issue 1 year ago • 0 comments

下面是我.github/workflows/autodeploy.yml中的内容

# 当有改动推送到master分支时,启动Action
name: 自动部署

on:
  push:
    branches:
      - main # 2020年10月后github新建仓库默认分支改为main,注意更改

  release:
    types:
      - published

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: 检查分支
      uses: actions/checkout@v2
      with:
        ref: main # 2020年10月后github新建仓库默认分支改为main,注意更改

    - name: 安装 Node
      uses: actions/setup-node@v1
      with:
        node-version: "18.x" #action使用的node版本,建议大版本和本地保持一致。可以在本地用node -v查询版本号。

    - name: 安装 Hexo
      run: |
        export TZ='Asia/Shanghai'
        npm install hexo-cli -g

    - name: 缓存 Hexo
      uses: actions/cache@v1
      id: cache
      with:
        path: node_modules
        key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}}

    - name: 安装依赖
      if: steps.cache.outputs.cache-hit != 'true'
      run: |
        npm install --save

    - name: 生成静态文件
      run: |
        hexo clean
        hexo generate
        hexo algolia

    
    - name: 部署到Github
      uses: JamesIves/github-pages-deploy-action@v4
      with:
        token: ghp_tdvI3xOp***********************
        repository-name: richarpao/richarpao.github.io
        branch: main
        folder: public
        commit-message: "${{ github.event.head_commit.message }} Updated By VacuoleAutoDeploy"

gitignore中的内容

.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/
.deploy_git*/
.idea
themes/Acrylic/.git

image

bladedevoff avatar Sep 28 '23 11:09 bladedevoff