-
Notifications
You must be signed in to change notification settings - Fork 644
38 lines (36 loc) · 1.53 KB
/
update-index.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: Update Index
on:
workflow_run:
workflows:
- "Update Dates"
branches:
- main
types:
- completed
jobs:
update-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Установка ключа для пользователя
run: |
set -eu
mkdir "$HOME/.ssh"
echo "${{ secrets.DEPLOY_KEY }}" > "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
ssh-keyscan -H dev.doka.guide >> ~/.ssh/known_hosts
- name: Публикация поискового индекса
run: |
CONTENT_PATH="/web/sites/search.doka.guide/www"
PORT=8070
npm install natural linkedom html-escaper markdown-it yaml-cat --global
npm link natural linkedom html-escaper markdown-it
yaml-cat -f json 'a11y/**/index.md' 'css/**/index.md' 'html/**/index.md' 'js/**/index.md' 'recipes/**/index.md' 'tools/**/index.md' -o search-meta.json
node .github/scripts/search-index.js
rsync --archive --progress --delete --compress search-content.json [email protected]:$CONTENT_PATH
export DOCKER_HOST="ssh://[email protected]"
docker stop search
docker run -dti --rm -p $PORT:$PORT --name search --mount type=bind,source=$CONTENT_PATH,target=/app/data search --search-content data/search-content.json --stop-words data/stop-search.json --dicts-dir data/dics --app-port $PORT