Skip to content

v0.34.0

v0.34.0 #111

Workflow file for this run

name: Deploy Index
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup rust
uses: ./.github/actions/setup-rust
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Build
shell: bash
id: build
run: |
cargo build --release --target aarch64-unknown-linux-gnu
- name: Create ssh key
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.INDEX_SERVER }} > ~/.ssh/known_hosts
if: steps.build.outcome == 'success'
- name: Upload target to server
id: upload
run: |
rsync -avz ./target/aarch64-unknown-linux-gnu/release/geode-index ${{ secrets.INDEX_USER }}@${{ secrets.INDEX_SERVER }}:${{ secrets.INDEX_COPY_LOCATION }}
rsync -avzr ./migrations ${{ secrets.INDEX_USER }}@${{ secrets.INDEX_SERVER }}:${{ secrets.MIGRATIONS_COPY_LOCATION }}
if: steps.build.outcome == 'success'
- name: Run update script
run: |
ssh ${{ secrets.INDEX_USER }}@${{ secrets.INDEX_SERVER }} "cd ${{ secrets.INDEX_UPDATE_SCRIPT_PATH }} && ./update.sh"
if: steps.build.outcome == 'success' && steps.upload.outcome == 'success'