Skip to content

CI

CI #1417

Workflow file for this run

name: CI
env:
TZ: Asia/Shanghai
on:
push:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: '30 16 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: npm
run: |
npm i -g hexo-cli
npm i
- name: hexo
run: |
hexo g --slient
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: penndu/my-website
publish_branch: master
publish_dir: ./public
- name: algolia
run: |
# hexo algolia
curl -X DELETE 'https://m.dusays.com/indexes/hexo' -H "Authorization: Bearer ${{secrets.MEILISEARCH_KEY}}"
curl -X POST 'https://m.dusays.com/indexes/hexo/documents/?primaryKey=uuid' -H "Authorization: Bearer ${{secrets.MEILISEARCH_KEY}}" -H "Content-Type: application/json" --data-binary '@public/content.json'