fi3ework / hexo-theme-archer

🎯 A smart and modern theme for Hexo.
https://fi3ework.github.io/hexo-theme-archer
MIT License
1.52k stars 273 forks source link

algolia自动更新工作流中,pandoc依赖缺失 #345

Closed lulu010722 closed 2 years ago

lulu010722 commented 2 years ago

尝试同时开启latex和algolia 按照开启algolia的教程,编写了新的workflow file,并新建了分支source,将源文件push到该分支上

但是在执行新建的actions的时候,出现了下面的问题 image

好像是因为github服务器上没有pandoc依赖,但是我不知道如何在workflow file里面下载,求教。

workflow file见下:

name: Hexo Blog CI & CD

on:
  push:
    branches:
      - source

jobs:
  pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: Cache NPM dependencies
        uses: actions/cache@v3
        with:
          path: node_modules
          key: ${{ runner.os }}-npm-cache
          restore-keys: |
            ${{ runner.os }}-npm-cache
      - name: Install Dependencies
        run: npm install
      - name: Get algolia objects
        run: npm run algolia
        env:
          HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}
      - name: Build
        run: npm run build
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          deploy_key: ${{ secrets.ACCESS_TOKEN }}
          publish_dir: ./public
          publish_branch: main  # deploying branch
LolipopJ commented 2 years ago

试试这个:https://zhuanlan.zhihu.com/p/508457566 ,在运行命令之前先安装 Pandoc。

cd /tmp
wget -c https://github.com/jgm/pandoc/releases/download/2.14.0.3/pandoc-2.14.0.3-1-amd64.deb
sudo dpkg -i pandoc-2.14.0.3-1-amd64.deb
lulu010722 commented 2 years ago

哇!成功了!确实是没有添加pandoc依赖的问题。 现在CI/CD确实可以成功了 不过看你的结构,比如你添加了博客,那么你push到origin/source,触发hexo CI/CD那个action,然后这个做完之后,继续做hexo的默认action,貌似有一点点慢。。 我尝试找个方法,看看能不能一次搞定。

总之,谢谢!