public-appservice 0.2.0

An appservice to make Matrix spaces publicly accessible.
Documentation
name: Deploy

on:
  push:
    branches: [ "main" ]
    paths: 
      - "src/**"
      - "Cargo.toml"
      - "Cargo.lock"
      - "build.rs"
      - ".github/workflows/deploy.yml"
  pull_request:
    branches: [ "main" ]

jobs:
  deploy:

    runs-on: ubuntu-24.04-arm

    steps:

    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Rust
      uses: dtolnay/rust-toolchain@stable
        
    - name: Build 
      run: cargo build --release
      
    - name: Setup SSH
      run: |
        mkdir -p ~/.ssh
        echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
        chmod 600 ~/.ssh/id_ed25519
        ssh-keyscan -H "${{ secrets.VPS_HOST }}" >> ~/.ssh/known_hosts
        ssh-keyscan -H "${{ secrets.VPS_HOST_DEV }}" >> ~/.ssh/known_hosts

    - name: Upload binary 
      run: |
        rsync -avz --progress target/release/public-appservice ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/home/${{ secrets.VPS_USER }}/public-appservice/