Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr1Furious committed Dec 26, 2024
1 parent af35aca commit 37db3e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ defaults:
jobs:
build:
runs-on: ${{ matrix.os }}
env:
HAS_SSH_KEY: ${{ secrets.SSH_KEY != '' }}
HAS_SERVER_USER: ${{ secrets.SERVER_USER != '' }}
HAS_SERVER_ADDR: ${{ secrets.SERVER_ADDR != '' }}
HAS_POST_DEPLOY_SCRIPT: ${{ secrets.POST_DEPLOY_SCRIPT_PATH != '' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -101,26 +106,27 @@ jobs:
fi
- name: Set up SSH
if: github.ref == 'refs/heads/master'
if: ${{ github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' && env.HAS_SERVER_USER == 'true' && env.HAS_SERVER_ADDR == 'true' }}
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: no

- name: Deploy to server
if: github.ref == 'refs/heads/master'
if: ${{ github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' && env.HAS_SERVER_USER == 'true' && env.HAS_SERVER_ADDR == 'true' }}
env:
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_ADDR: ${{ secrets.SERVER_ADDR }}
SERVER_PATH: ${{ secrets.SERVER_PATH }}
run: scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null build/* $SERVER_USER@$SERVER_ADDR:$SERVER_PATH/

- name: Purge Cloudflare cache
if: github.ref == 'refs/heads/master'
if: ${{ github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' && env.HAS_SERVER_USER == 'true' && env.HAS_SERVER_ADDR == 'true' && env.HAS_POST_DEPLOY_SCRIPT == 'true' }}
env:
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_ADDR: ${{ secrets.SERVER_ADDR }}
run: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SERVER_USER@$SERVER_ADDR '~/purge_cf_cache.sh'
POST_DEPLOY_SCRIPT_PATH: ${{ secrets.POST_DEPLOY_SCRIPT_PATH }}
run: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SERVER_USER@$SERVER_ADDR "bash \"$POST_DEPLOY_SCRIPT_PATH\""

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
5 changes: 5 additions & 0 deletions launcher/src/update_app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ pub fn run_gui(config: &runtime_config::Config) {
return;
}

if build_config::get_auto_update_base().is_none() {
info!("Auto update URL not set, skipping auto-update");
return;
}

let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_inner_size((300.0, 150.0))
Expand Down

0 comments on commit 37db3e0

Please sign in to comment.