Start setup for search index in CI #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: develop | |
| on: | |
| push: | |
| branches: | |
| - "develop" | |
| jobs: | |
| build-search-index: | |
| name: "Build search index" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: prefix-dev/setup-pixi@v0.9.2 | |
| with: | |
| run-install: false | |
| - name: Install toolchain | |
| run: rustup toolchain install stable | |
| - name: Configure SSH | |
| run: | | |
| mkdir -p ~/.ssh/ | |
| echo "$SSH_KEY" > ~/.ssh/prod.key | |
| chmod 600 ~/.ssh/prod.key | |
| cat >>~/.ssh/config <<END | |
| Host prod | |
| HostName $SSH_HOST | |
| User $SSH_USER | |
| IdentityFile ~/.ssh/prod.key | |
| StrictHostKeyChecking no | |
| END | |
| env: | |
| SSH_USER: ${{ secrets.SSH_USERNAME }} | |
| SSH_KEY: ${{ secrets.SSHKEY }} | |
| SSH_HOST: ${{ secrets.HOST }} | |
| - name: Download index data | |
| run: | | |
| mkdir -p search_preprocess/data | |
| cd search_preprocess/data | |
| ../download_data.sh | |
| ls -lh | |
| - name: Build search index | |
| run: | | |
| cd search_preprocess | |
| pixi run python src/preprocess_search_data.py | |
| pixi run python src/filter_search_data.py | |
| pixi run python src/preprocess_flying_site_data.py | |
| mkdir -p ../backend-rust/data | |
| cp ./data/search_data_*.jsonl ../backend-rust/data/ | |
| cd ../backend-rust | |
| cargo run --bin preprocess_search_index --release | |
| ls -lh data/ | |
| - name: Upload search index | |
| run: | | |
| scp -o StrictHostKeyChecking=no data/search_data_flying_sites.jsonl hikeandfly:~/data |