Skip to content

Commit aa0786c

Browse files
committed
Test
1 parent b526576 commit aa0786c

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,48 @@ name: main
22

33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [ main, master, ci_test ]
66
workflow_dispatch:
77

88
jobs:
99
build:
1010
runs-on: ubuntu-24.04
11+
1112
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v4
13+
- name: Checkout main repo
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v4
1418
with:
1519
python-version: '3.13.3'
1620
architecture: x64
1721

18-
- name: Install all dependencies
22+
- name: Install Pipenv
23+
run: python -m pip install --upgrade pipenv
24+
25+
- name: Install Algolia Client in Pipenv
26+
run: pipenv install "algoliasearch>=4.0,<5.0"
27+
28+
- name: Create deleteIndex.py script
1929
run: |
20-
python -m pip install --upgrade pipenv
21-
python -m pip install "algoliasearch>=4.0,<5.0"
30+
mkdir tmp
31+
echo "from algoliasearch.search_client import SearchClient" > tmp/deleteIndex.py
32+
echo "client = SearchClient.create(\"AKRT8SVTPP\", \"${{ secrets.API_KEY }}\")" >> tmp/deleteIndex.py
33+
echo "index = client.init_index(\"hardwario\")" >> tmp/deleteIndex.py
34+
echo "index.clear_objects()" >> tmp/deleteIndex.py
35+
echo "print(\"Deleted records.\")" >> tmp/deleteIndex.py
2236
23-
- name: Clone algolia repository
37+
- name: Run deleteIndex.py using Pipenv
38+
run: pipenv run python tmp/deleteIndex.py
39+
40+
- name: Clone Algolia scraper
2441
uses: actions/checkout@v2
2542
with:
2643
repository: algolia/docsearch-scraper
2744
path: algolia
2845

29-
- name: Prepare the algolia
46+
- name: Prepare Algolia config
3047
run: |
3148
mv algolia/.env.example algolia/.env
3249
echo { > algolia/config.json
@@ -49,19 +66,9 @@ jobs:
4966
sed -r -i'' 's/APPLICATION_ID=/APPLICATION_ID=AKRT8SVTPP/' algolia/.env
5067
sed -r -i'' 's/API_KEY=/API_KEY=${{ secrets.API_KEY }}/' algolia/.env
5168
52-
- name: Delete Old Index
53-
run: |
54-
mkdir tmp
55-
echo "from algoliasearch.search_client import SearchClient" > tmp/deleteIndex.py
56-
echo "client = SearchClient.create(\"AKRT8SVTPP\", \"${{ secrets.API_KEY }}\")" >> tmp/deleteIndex.py
57-
echo "index = client.init_index(\"hardwario\")" >> tmp/deleteIndex.py
58-
echo "index.clear_objects()" >> tmp/deleteIndex.py
59-
echo "print(\"Deleted records.\")" >> tmp/deleteIndex.py
60-
61-
pipenv install "algoliasearch>=4.0,<5.0"
62-
pipenv run python tmp/deleteIndex.py
63-
64-
- name: Build The Index
69+
- name: Run Algolia DocSearch scraper
6570
run: |
6671
chmod +x algolia/docsearch
67-
cd algolia ; pipenv install ; pipenv run ./docsearch run config.json
72+
cd algolia
73+
pipenv install
74+
pipenv run ./docsearch run config.json

0 commit comments

Comments
 (0)