Update aloglia.yml

This commit is contained in:
weisheng 2023-07-29 23:55:34 +08:00 committed by GitHub
parent ef439d453f
commit 9d67d57afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,46 @@
name: Netlify -> Algolia Crawler
on:
push:
branches: [ master ]
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
# name: Algolia Upload Records jobs:
# on: algolia_recrawl:
# [push] #推送时执行 name: Algolia Recrawl
# jobs: runs-on: ubuntu-latest
# algolia: steps:
# runs-on: ubuntu-latest # checkout this repo
# steps: - name: Checkout Repo
# - uses: actions/checkout@v2 uses: actions/checkout@v2
# - name: Get the content of algolia.json as config
# id: algolia_config # We don't know when the site will be deployed, we just wait a few seconds
# run: echo "::set-output name=config::$(cat algolia.json | jq -r tostring)" # Better solutions can be found
# - name: Algolia Crawler Automatic Crawl - name: Sleep for 30s
# uses: algolia/algoliasearch-crawler-github-actions@v1.1.0 run: sleep 30
# id: algolia_crawler
# with: # mandatory parameters # For PRs
# crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} - name: Netlify-PR => Algolia crawler creation and recrawl on preview (Pull Request)
# crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} if: github.ref != 'refs/heads/master'
# algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} uses: algolia/algoliasearch-crawler-github-actions@v1
# algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} id: crawler_pr
# site-url: 'https://wot-design-uni.netlify.app' with:
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }}
crawler-api-key: ${{ secrets.CRAWLER_API_KEY }}
algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }}
algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }}
site-url: 'https://deploy-preview-${{ github.event.pull_request.number }}--wot-design-uni.netlify.app/'
override-config: true
# For main branch
- name: Netlify-MAIN => Algolia crawler creation and recrawl (Push on Main branch)
if: github.ref == 'refs/heads/master'
uses: algolia/algoliasearch-crawler-github-actions@v1
id: crawler_push
with:
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }}
crawler-api-key: ${{ secrets.CRAWLER_API_KEY }}
algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }}
algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }}
site-url: 'https://wot-design-uni.netlify.app/'
override-config: true