forked from hyperjumptech/monika
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.43 KB
/
docs.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build and Deploy Docs to Github Pages
on:
workflow_dispatch:
release:
types: [created]
schedule:
- cron: '0 9 * * 3' # Every 9AM on Wednesday
env:
CI: true
NEXT_PUBLIC_ALGOLIA_APPLICATION_ID: ${{secrets.NEXT_PUBLIC_ALGOLIA_APPLICATION_ID}}
ALGOLIA_ADMIN_API_KEY: ${{secrets.ALGOLIA_ADMIN_API_KEY}}
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: ${{secrets.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY}}
permissions:
issues: read
pull-requests: read
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: ✍🏻 Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 📥 Install deps
run: npm ci --legacy-peer-deps
- name: 👷♂️ Build
run: npm run build
- name: 🚀 Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/out # The folder the action should deploy.
clean: true # Automatically remove deleted files from the deploy branch
algolia:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: ✍🏻 Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: 📥 Install deps
run: npm ci --legacy-peer-deps
- name: Install jq
run: sudo apt-get install -y jq
- name: 🔎 Send to Algolia
uses: actions/checkout@v4
- name: Get the content of algolia.json as config
id: algolia_config
run: echo "::set-output name=config::$(cat algolia.json | jq -r tostring)"
- name: Push indices to Algolia
uses: signcl/docsearch-scraper-action@master
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
CONFIG: ${{ steps.algolia_config.outputs.config }}