Skip to content

chore: 移除 Algolia 管理 API 密钥 #3

chore: 移除 Algolia 管理 API 密钥

chore: 移除 Algolia 管理 API 密钥 #3

Workflow file for this run

name: Deploy static content to Pages
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# 优化:收紧了 contents 权限
permissions:
contents: read
id-token: write
pages: write
jobs:
docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Update Algolia Index
if: github.actor != 'nektos/act'
env:
HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}
run: npm run algolia
- name: Upload GitHub Pages artifact
if: github.actor != 'nektos/act'
uses: actions/upload-pages-artifact@v3
with:
path: ./public
- name: Deploy to GitHub Pages
id: deployment
if: github.ref == 'refs/heads/master' && github.actor != 'nektos/act'
uses: actions/deploy-pages@v4