|
6 | 6 | - "develop" |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - clippy: |
| 9 | + build-search-index: |
| 10 | + name: "Build search index" |
10 | 11 | runs-on: ubuntu-latest |
11 | 12 | steps: |
12 | 13 | - uses: actions/checkout@v2 |
| 14 | + - uses: prefix-dev/setup-pixi@v0.9.2 |
| 15 | + with: |
| 16 | + run-install: false |
13 | 17 | - name: Install toolchain |
14 | 18 | run: rustup toolchain install stable |
15 | | - - name: Install clippy |
16 | | - run: rustup component add clippy |
17 | | - - name: Run clippy |
| 19 | + - name: Configure SSH |
18 | 20 | run: | |
19 | | - cd backend-rust |
20 | | - cargo clippy --all-targets --all-features -- -D warnings |
| 21 | + mkdir -p ~/.ssh/ |
| 22 | + echo "$SSH_KEY" > ~/.ssh/prod.key |
| 23 | + chmod 600 ~/.ssh/prod.key |
| 24 | + cat >>~/.ssh/config <<END |
| 25 | + Host prod |
| 26 | + HostName $SSH_HOST |
| 27 | + User $SSH_USER |
| 28 | + IdentityFile ~/.ssh/prod.key |
| 29 | + StrictHostKeyChecking no |
| 30 | + END |
| 31 | + env: |
| 32 | + SSH_USER: ${{ secrets.SSH_USERNAME }} |
| 33 | + SSH_KEY: ${{ secrets.SSHKEY }} |
| 34 | + SSH_HOST: ${{ secrets.HOST }} |
21 | 35 |
|
22 | | - test: |
23 | | - runs-on: ubuntu-latest |
24 | | - steps: |
25 | | - - uses: actions/checkout@v2 |
26 | | - - name: Run tests |
| 36 | + - name: Download index data |
| 37 | + run: | |
| 38 | + mkdir -p search_preprocess/data |
| 39 | + cd search_preprocess/data |
| 40 | + ../download_data.sh |
| 41 | + ls -lh |
| 42 | + - name: Build search index |
27 | 43 | run: | |
28 | | - cd backend-rust |
29 | | - ./download_test_data.sh |
30 | | - cargo test --all-targets |
| 44 | + cd search_preprocess |
| 45 | + pixi install |
| 46 | + pixi run python src/preprocess_search_data.py |
| 47 | + pixi run python src/filter_search_data.py |
| 48 | + pixi run python src/preprocess_flying_site_data.py |
| 49 | + mkdir -p ../backend-rust/data |
| 50 | + cp ./data/search_data_*.jsonl ../backend-rust/data/ |
| 51 | + cd ../backend-rust |
| 52 | + cargo run --bin preprocess_search_index --release |
31 | 53 |
|
32 | | - docker: |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - name: Set up Docker Buildx |
36 | | - uses: docker/setup-buildx-action@v2 |
37 | | - - name: Login to Docker Hub |
38 | | - uses: docker/login-action@v2 |
39 | | - with: |
40 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
41 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
42 | | - - name: Build docker image |
43 | | - uses: docker/build-push-action@v4 |
44 | | - with: |
45 | | - push: true |
46 | | - tags: hoff97/hikeandfly:develop |
47 | | - cache-from: type=registry,ref=hoff97/hikeandfly:develop |
48 | | - cache-to: type=inline |
| 54 | + ls -lh data/ |
| 55 | + - name: Upload search index |
| 56 | + run: | |
| 57 | + scp -o StrictHostKeyChecking=no data/search_data_flying_sites.jsonl hikeandfly:~/data |
0 commit comments