-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (38 loc) · 1.07 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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'