From 3b5f0dc2e5d0b17f128c7496565b48bfad9d37f0 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Tue, 31 Mar 2026 17:21:33 +0300 Subject: [PATCH 1/8] Attempt 2 for workflow --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 630df8a..2c15d82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: main on: push: branches: - - main + - teaser-2026 workflow_dispatch: inputs: ref: @@ -16,7 +16,7 @@ jobs: build: uses: ./.github/workflows/build.yml with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }} + ref: ${{ github.event.inputs.ref || github.ref_name }} secrets: USER_AUTH: ${{ secrets.USER_AUTH }} From fc33c899e2452f4842324110d231211f871f408f Mon Sep 17 00:00:00 2001 From: v4ltages Date: Tue, 31 Mar 2026 17:31:43 +0300 Subject: [PATCH 2/8] Ignore drizzle if branch is not main --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b992a7f..245d154 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,14 +35,17 @@ jobs: run: bun install - name: Ensure symlink to database before Drizzle migrations + if: ${{ inputs.ref == 'main' }} run: | rm -rf $GITHUB_WORKSPACE/data ln -s ~/data $GITHUB_WORKSPACE/data - name: Generate Drizzle schema + if: ${{ inputs.ref == 'main' }} run: bun drizzle-kit generate - name: Run Drizzle migrations + if: ${{ inputs.ref == 'main' }} run: bun drizzle-kit migrate - name: Build project From c76c50a304b7dba2bf27a329d03faf29ee2056c0 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Tue, 31 Mar 2026 19:08:01 +0300 Subject: [PATCH 3/8] Remove .next cache clear in workflow --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 245d154..dfbec38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,6 @@ jobs: build: runs-on: prox-1 steps: - - name: Clear .next cache - env: - SUDO_PASSWORD: ${{ secrets.USER_AUTH }} - run: echo "$SUDO_PASSWORD" | sudo -S rm -rf $GITHUB_WORKSPACE/.next - - name: Checkout code uses: actions/checkout@v4 with: From 426f71e425db507d56865e1ef5d7549f840b5860 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Thu, 30 Apr 2026 16:54:34 +0300 Subject: [PATCH 4/8] Workflow --- .github/workflows/build.yml | 7 ++++++- .github/workflows/deploy.yml | 8 +++++++- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfbec38..f95e9ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,13 +8,18 @@ on: required: false default: teaser-2026 type: string + runner: + description: Runner label to use for the build + required: false + default: prox-1 + type: string secrets: USER_AUTH: required: true jobs: build: - runs-on: prox-1 + runs-on: ${{ inputs.runner }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9350e14..9bfc7a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,13 +2,19 @@ name: deploy on: workflow_call: + inputs: + runner: + description: Runner label to use for the deploy + required: false + default: prox-1 + type: string secrets: USER_AUTH: required: true jobs: deploy: - runs-on: prox-1 + runs-on: ${{ inputs.runner }} steps: - name: Restart NextJS service env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c15d82..54eb60e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - teaser-2026 + - development workflow_dispatch: inputs: ref: @@ -12,16 +13,42 @@ on: default: teaser-2026 type: string +env: + REF_NAME: ${{ github.event.inputs.ref || github.ref_name }} + jobs: - build: + build_teaser: + if: ${{ env.REF_NAME == 'teaser-2026' }} uses: ./.github/workflows/build.yml with: - ref: ${{ github.event.inputs.ref || github.ref_name }} + ref: ${{ env.REF_NAME }} + runner: prox-1 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} - deploy: - needs: build + deploy_teaser: + if: ${{ env.REF_NAME == 'teaser-2026' }} + needs: build_teaser uses: ./.github/workflows/deploy.yml + with: + runner: prox-1 + secrets: + USER_AUTH: ${{ secrets.USER_AUTH }} + + build_dev: + if: ${{ env.REF_NAME == 'development' }} + uses: ./.github/workflows/build.yml + with: + ref: ${{ env.REF_NAME }} + runner: prox-2 + secrets: + USER_AUTH: ${{ secrets.USER_AUTH }} + + deploy_dev: + if: ${{ env.REF_NAME == 'development' }} + needs: build_dev + uses: ./.github/workflows/deploy.yml + with: + runner: prox-2 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} From 84d20128752c5bdb6be91bf457b2cff3124228e9 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Thu, 30 Apr 2026 16:57:14 +0300 Subject: [PATCH 5/8] main fix --- .github/workflows/main.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54eb60e..9a66be7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,21 +13,18 @@ on: default: teaser-2026 type: string -env: - REF_NAME: ${{ github.event.inputs.ref || github.ref_name }} - jobs: build_teaser: - if: ${{ env.REF_NAME == 'teaser-2026' }} + if: ${{ (github.event.inputs.ref || github.ref_name) == 'teaser-2026' }} uses: ./.github/workflows/build.yml with: - ref: ${{ env.REF_NAME }} + ref: ${{ github.event.inputs.ref || github.ref_name }} runner: prox-1 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} deploy_teaser: - if: ${{ env.REF_NAME == 'teaser-2026' }} + if: ${{ (github.event.inputs.ref || github.ref_name) == 'teaser-2026' }} needs: build_teaser uses: ./.github/workflows/deploy.yml with: @@ -36,16 +33,16 @@ jobs: USER_AUTH: ${{ secrets.USER_AUTH }} build_dev: - if: ${{ env.REF_NAME == 'development' }} + if: ${{ (github.event.inputs.ref || github.ref_name) == 'development' }} uses: ./.github/workflows/build.yml with: - ref: ${{ env.REF_NAME }} + ref: ${{ github.event.inputs.ref || github.ref_name }} runner: prox-2 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} deploy_dev: - if: ${{ env.REF_NAME == 'development' }} + if: ${{ (github.event.inputs.ref || github.ref_name) == 'development' }} needs: build_dev uses: ./.github/workflows/deploy.yml with: From f62f9ae299f025e002f663e7f19c5b58c47aff96 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Thu, 30 Apr 2026 17:05:49 +0300 Subject: [PATCH 6/8] Only allow development branch to be built & deploy --- .github/workflows/build.yml | 9 ++------- .github/workflows/deploy.yml | 8 +------- .github/workflows/main.yml | 38 +++--------------------------------- 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f95e9ca..ede7d96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,12 +6,7 @@ on: ref: description: Branch or tag to checkout required: false - default: teaser-2026 - type: string - runner: - description: Runner label to use for the build - required: false - default: prox-1 + default: development type: string secrets: USER_AUTH: @@ -19,7 +14,7 @@ on: jobs: build: - runs-on: ${{ inputs.runner }} + runs-on: prox-2 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9bfc7a3..cfe5f8a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,19 +2,13 @@ name: deploy on: workflow_call: - inputs: - runner: - description: Runner label to use for the deploy - required: false - default: prox-1 - type: string secrets: USER_AUTH: required: true jobs: deploy: - runs-on: ${{ inputs.runner }} + runs-on: prox-2 steps: - name: Restart NextJS service env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a66be7..efdf567 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,49 +3,17 @@ name: main on: push: branches: - - teaser-2026 - development workflow_dispatch: - inputs: - ref: - description: Branch or tag to build and deploy - required: false - default: teaser-2026 - type: string jobs: - build_teaser: - if: ${{ (github.event.inputs.ref || github.ref_name) == 'teaser-2026' }} + build: uses: ./.github/workflows/build.yml - with: - ref: ${{ github.event.inputs.ref || github.ref_name }} - runner: prox-1 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} - deploy_teaser: - if: ${{ (github.event.inputs.ref || github.ref_name) == 'teaser-2026' }} - needs: build_teaser + deploy: + needs: build uses: ./.github/workflows/deploy.yml - with: - runner: prox-1 - secrets: - USER_AUTH: ${{ secrets.USER_AUTH }} - - build_dev: - if: ${{ (github.event.inputs.ref || github.ref_name) == 'development' }} - uses: ./.github/workflows/build.yml - with: - ref: ${{ github.event.inputs.ref || github.ref_name }} - runner: prox-2 - secrets: - USER_AUTH: ${{ secrets.USER_AUTH }} - - deploy_dev: - if: ${{ (github.event.inputs.ref || github.ref_name) == 'development' }} - needs: build_dev - uses: ./.github/workflows/deploy.yml - with: - runner: prox-2 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} From a0d2b4933e9e2c550c16f47df416b5ab844a8110 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Thu, 30 Apr 2026 17:18:08 +0300 Subject: [PATCH 7/8] Forgot to change migrations --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ede7d96..7114875 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,11 +30,10 @@ jobs: run: bun install - name: Ensure symlink to database before Drizzle migrations - if: ${{ inputs.ref == 'main' }} run: | - rm -rf $GITHUB_WORKSPACE/data - ln -s ~/data $GITHUB_WORKSPACE/data - + rm -rf "$GITHUB_WORKSPACE/data" + ln -s /home/github/data "$GITHUB_WORKSPACE/data" + - name: Generate Drizzle schema if: ${{ inputs.ref == 'main' }} run: bun drizzle-kit generate From 623eb808dabe8f7434bd8c727fa67050a7bb8f5d Mon Sep 17 00:00:00 2001 From: Voltages Date: Mon, 11 May 2026 17:30:03 +0300 Subject: [PATCH 8/8] Delete full .github/workflows --- .github/workflows/build.yml | 46 ------------------------------------ .github/workflows/deploy.yml | 26 -------------------- .github/workflows/main.yml | 19 --------------- 3 files changed, 91 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 7114875..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: build - -on: - workflow_call: - inputs: - ref: - description: Branch or tag to checkout - required: false - default: development - type: string - secrets: - USER_AUTH: - required: true - -jobs: - build: - runs-on: prox-2 - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install - - - name: Ensure symlink to database before Drizzle migrations - run: | - rm -rf "$GITHUB_WORKSPACE/data" - ln -s /home/github/data "$GITHUB_WORKSPACE/data" - - - name: Generate Drizzle schema - if: ${{ inputs.ref == 'main' }} - run: bun drizzle-kit generate - - - name: Run Drizzle migrations - if: ${{ inputs.ref == 'main' }} - run: bun drizzle-kit migrate - - - name: Build project - run: bun --bun run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index cfe5f8a..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: deploy - -on: - workflow_call: - secrets: - USER_AUTH: - required: true - -jobs: - deploy: - runs-on: prox-2 - steps: - - name: Restart NextJS service - env: - SUDO_PASSWORD: ${{ secrets.USER_AUTH }} - run: echo "$SUDO_PASSWORD" | sudo -S systemctl restart nextjs.service - - - name: Reload systemd daemon - env: - SUDO_PASSWORD: ${{ secrets.USER_AUTH }} - run: echo "$SUDO_PASSWORD" | sudo -S systemctl daemon-reload - - - name: Check service status - env: - SUDO_PASSWORD: ${{ secrets.USER_AUTH }} - run: echo "$SUDO_PASSWORD" | sudo -S systemctl status nextjs.service --no-pager diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index efdf567..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: main - -on: - push: - branches: - - development - workflow_dispatch: - -jobs: - build: - uses: ./.github/workflows/build.yml - secrets: - USER_AUTH: ${{ secrets.USER_AUTH }} - - deploy: - needs: build - uses: ./.github/workflows/deploy.yml - secrets: - USER_AUTH: ${{ secrets.USER_AUTH }}