Skip to content

Commit

Permalink
fix: 上传的 index.json 为空
Browse files Browse the repository at this point in the history
改用 rxrw/algolia-index-uploader@v1,将上传 index.json 至 Algolia 的步骤移至 build 这一 job 内。
  • Loading branch information
Young-Mann committed Jan 20, 2023
1 parent 1557a51 commit 51672bc
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ jobs:
uses: actions/upload-pages-artifact@v1
with:
path: ./public

- name: Upload "index.json" to Algolia
uses: rxrw/algolia-index-uploader@v1
with:
index_path: "./public/index.json"
algolia_index_name: "shuosc_index_with_prefix"
algolia_index_admin_key: ${{ secrets.ALGOLIA_APIKEY }}
algolia_index_id: "WDJUT0BGDL"

# Deployment job
deploy:
environment:
Expand All @@ -67,17 +74,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

# Upload "index.json" to Algolia
generate-algolia:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: caibingcheng/hugo-algolia2@v1
with:
input: "./posts/**"
output: "./algolia.json"
index: "shuosc_index_with_prefix"
apikey: ${{ secrets.ALGOLIA_APIKEY }}
appid: "WDJUT0BGDL"
uses: actions/deploy-pages@v1

0 comments on commit 51672bc

Please sign in to comment.