-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (88 loc) · 3.13 KB
/
main.yml
File metadata and controls
94 lines (88 loc) · 3.13 KB
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
93
94
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
name: CI
on:
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Pull LFS files
run: git lfs pull
- name: Build
env:
GOOGLE_ANALYTICS: ${{ secrets.GOOGLE_ANALYTICS }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
run: |
npm ci
npm run build
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
# Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
algolia:
name: Algolia Search
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create env file
run: |
touch .env
echo APPLICATION_ID=${{ secrets.ALGOLIA_APP_ID }} >> .env
echo API_KEY=${{ secrets.ALGOLIA_API_KEY }} >> .env
- name: "Crawler"
run: docker run --env-file=.env -e "CONFIG=$(cat algolia.config.json | jq -r tostring)" algolia/docsearch-scraper
langchain:
name: Langchain DB
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/scripts
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python Dependencies
run: pip install langchain==0.0.321
- name: Make Langchain DB
run: |
python make_langchain_db.py
# Commit&Push: https://github.com/orgs/community/discussions/26672#discussioncomment-3252794
- name: Commit files
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "github-actions"
git add --all
if [ -z "$(git status --porcelain)" ]; then
echo "::set-output name=push::false"
else
git commit -m "Add langchain_db.pkl" -a
echo "::set-output name=push::true"
fi
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}