From 04448922b05b30a9216630e8cb435f7cd3127e1a Mon Sep 17 00:00:00 2001 From: Maksim Kostromin Date: Mon, 13 Jul 2026 07:33:50 +0000 Subject: [PATCH 1/4] ci: add manual dependency update workflow --- .github/workflows/ci.yaml | 21 ------ .github/workflows/dependency-updates.yml | 87 ++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/dependency-updates.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b6e6935..f80b6f2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,24 +21,3 @@ jobs: - run: bun install -E - run: bun run build - run: bun run build-github-pages - npm-check-updates: - environment: - name: ci - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - uses: actions/cache@v4 - with: - path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-bun- - - run: bunx npm-check-updates -u - - run: bun install - - run: npm run build - - run: npm run clean - - run: npm run build-github-pages diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml new file mode 100644 index 0000000..b6e6e39 --- /dev/null +++ b/.github/workflows/dependency-updates.yml @@ -0,0 +1,87 @@ +name: Dependency Updates +on: + workflow_dispatch: + inputs: + target_branch: + description: Branch to update + required: true + default: master + commit_message: + description: Commit message + required: true + default: "chore(deps): update dependencies" +permissions: + contents: write +concurrency: + group: dependency-updates-${{ inputs.target_branch }} + cancel-in-progress: false +jobs: + update-dependencies: + runs-on: ubuntu-latest + steps: + - name: Ensure push token is configured + env: + WORKFLOW_PUSH_TOKEN: ${{ secrets.WORKFLOW_PUSH_TOKEN }} + run: | + if [ -z "$WORKFLOW_PUSH_TOKEN" ]; then + echo "::error::Missing WORKFLOW_PUSH_TOKEN secret." + echo "::error::Use a PAT for pushes from this workflow so the resulting commit triggers push-based workflows such as GitHub Pages deploy." + exit 1 + fi + + - name: Checkout target branch + uses: actions/checkout@v4 + with: + ref: ${{ inputs.target_branch }} + token: ${{ secrets.WORKFLOW_PUSH_TOKEN }} + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-bun- + + - name: Update dependency versions + run: bunx npm-check-updates -u + + - name: Install updated dependencies + run: bun install -E + + - name: Validate application build + run: bun run build + + - name: Validate GitHub Pages build + run: bun run build-github-pages + + - name: Detect repository changes + id: changes + run: | + if git diff --quiet --exit-code; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Commit and push dependency updates + if: steps.changes.outputs.changed == 'true' + env: + TARGET_BRANCH: ${{ inputs.target_branch }} + COMMIT_MESSAGE: ${{ inputs.commit_message }} + run: | + git config user.name "Maksim Kostromin" + git config user.email "daggerok@gmail.com" + git add package.json bun.lock + git commit -m "$COMMIT_MESSAGE" + git push origin "HEAD:${TARGET_BRANCH}" + + - name: No dependency updates found + if: steps.changes.outputs.changed != 'true' + run: echo "No dependency updates were found. Nothing to commit." From cde227043758f1090081b3b19d1e31864bfedb7a Mon Sep 17 00:00:00 2001 From: Maksim Kostromin Date: Mon, 13 Jul 2026 07:33:50 +0000 Subject: [PATCH 2/4] ci: make test script build and restrict pages deploy to master --- .github/workflows/github-pages.yml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 64075d8..43b0405 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -1,6 +1,8 @@ name: GitHub Pages on: push: + branches: + - master workflow_dispatch: permissions: contents: read diff --git a/package.json b/package.json index 27af884..d3a581d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "restart": "pm2 restart app", "stop": "pm2 kill", "logs": "pm2 logs", - "test": "jest src", + "test": "npm run build", "dev": "npm run test -- --watchAll" }, "keywords": [ From 18df06bc2962dbfe670571dd4d9a89327ed0ae8a Mon Sep 17 00:00:00 2001 From: Maksim Kostromin Date: Mon, 13 Jul 2026 07:33:50 +0000 Subject: [PATCH 3/4] ci: restore npm-check-updates verification job --- .github/workflows/ci.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f80b6f2..b6e6935 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,3 +21,24 @@ jobs: - run: bun install -E - run: bun run build - run: bun run build-github-pages + npm-check-updates: + environment: + name: ci + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-bun- + - run: bunx npm-check-updates -u + - run: bun install + - run: npm run build + - run: npm run clean + - run: npm run build-github-pages From 323d1e8b94429136c9091cbaade3600eec6fb19e Mon Sep 17 00:00:00 2001 From: Maksim Kostromin Date: Mon, 13 Jul 2026 07:35:58 +0000 Subject: [PATCH 4/4] ci: allow pages deploys from PR branches --- .github/workflows/github-pages.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 43b0405..64075d8 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -1,8 +1,6 @@ name: GitHub Pages on: push: - branches: - - master workflow_dispatch: permissions: contents: read