2023-10-20 02:53:09 +00:00
|
|
|
name: Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: rustup toolchain install stable --profile minimal
|
2023-10-20 03:12:31 +00:00
|
|
|
|
2023-10-20 02:53:09 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2023-10-20 03:12:31 +00:00
|
|
|
|
|
|
|
- name: Check sqlx prepare files
|
|
|
|
run: cargo sqlx prepare --check
|
|
|
|
|
2023-10-20 02:53:09 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: cargo test --verbose
|
2023-10-20 03:12:31 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --release --verbose
|
|
|
|
|
2023-10-20 02:53:09 +00:00
|
|
|
- name: Install SSH Key
|
|
|
|
uses: shimataro/ssh-key-action@v2
|
|
|
|
with:
|
|
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
|
2023-10-20 03:12:31 +00:00
|
|
|
|
2023-10-20 02:53:09 +00:00
|
|
|
- name: Adding Known Hosts
|
|
|
|
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
2023-10-20 03:12:31 +00:00
|
|
|
|
2023-10-20 02:53:09 +00:00
|
|
|
- name: Deploy with rsync
|
|
|
|
run: rsync -avz ./target/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/crawlnicle/crawlnicle/target/
|