v0.33.0 #108
Workflow file for this run
This file contains 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: Deploy Index | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install stuff | |
run: sudo apt-get update && sudo apt-get install --assume-yes --no-install-recommends g++-aarch64-linux-gnu | |
- name: Setup env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Install rust | |
run: | | |
rustup toolchain install stable --profile minimal | |
rustup target add aarch64-unknown-linux-gnu | |
- name: Setup cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
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' |