Skip to content

更新文章

更新文章 #134

Workflow file for this run

name: Update Algolia Index
on:
workflow_dispatch:
push:
branches:
- master
jobs:
update_algolia_index:
name: Update Algolia Index
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
run: |
version=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep tag_name | cut -d "\"" -f4 | sed 's/v//')
curl -fsSLo hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${version}/hugo_extended_${version}_linux-amd64.deb"
sudo dpkg -i hugo.deb
- name: Build
run: hugo --gc --minify
- name: Update Algolia Index
uses: tilburgsciencehub/algolia-uploader@v1
with:
app_id: EQKXDMZYXP
admin_key: ${{ secrets.ALGOLIA_ADMIN_KEY }}
index_name: index
index_file_path: ./public/index.json