From 2999579bc528f2af6e34617fd75f503b4516e3a6 Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Mon, 25 Aug 2025 15:39:31 +0300 Subject: [PATCH] Optimize build workflows to trigger only when important files changed --- .github/workflows/build.yml | 4 +--- .github/workflows/deploy.yml | 10 ++++++++++ frontend/src/{ => electron}/electron.ts | 4 ++-- frontend/src/main.ts | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) rename frontend/src/{ => electron}/electron.ts (81%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9482592..2d4af44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,12 +3,10 @@ name: Build Electron Apps on: workflow_dispatch: push: - branches: ["main", "electron"] + branches: ["main"] paths: - 'frontend/**' - 'package.json' - - 'package-lock.json' - - 'frontend/electron/**' - '.github/workflows/build.yml' concurrency: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ce9df23..e461920 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,16 @@ on: # Runs on pushes targeting the default branch push: branches: ["main"] + paths: + - "backend/**" + - "frontend/**" + - "deployment/**" + - "**/package.json" + - ".nvmrc" + - ".github/workflows/deploy.yml" + - "!frontend/electron/**" + - "!frontend/src/electron/**" + - "!**.d.ts" workflow_dispatch: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. diff --git a/frontend/src/electron.ts b/frontend/src/electron/electron.ts similarity index 81% rename from frontend/src/electron.ts rename to frontend/src/electron/electron.ts index c5646d0..948424a 100644 --- a/frontend/src/electron.ts +++ b/frontend/src/electron/electron.ts @@ -1,5 +1,5 @@ -import "../electron.d.ts"; -import { PRODUCT_NAME } from "./config"; +import "../../electron.d.ts"; +import { PRODUCT_NAME } from "../config.ts"; if (window.electronInterface !== undefined) { console.log("Running in Electron"); diff --git a/frontend/src/main.ts b/frontend/src/main.ts index a2d3cc4..13c0d55 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -16,4 +16,4 @@ import "./init"; import "./profile"; import "./message-context-menu"; import "./user-profile-dialog"; -import "./electron"; \ No newline at end of file +import "./electron/electron"; \ No newline at end of file