From 2c4d0adc7411078976f7f8cd4ab58f08823c02db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimondas=20Rimkevi=C4=8Dius?= Date: Thu, 23 Apr 2026 03:25:46 +0300 Subject: [PATCH 1/5] infra: add CI workflow for PRs --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..82ca237 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + pull_request: + branches: [main] + +jobs: + lint-and-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm install + - run: npm -w frontend run lint + - run: npm -w worker run lint + - run: npm -w frontend run build + - run: npm -w worker run build From 04d91637d375dda85a19687ab4b68cbf33dd727b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimondas=20Rimkevi=C4=8Dius?= Date: Thu, 23 Apr 2026 03:29:19 +0300 Subject: [PATCH 2/5] infra: read node version from package.json in CI workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82ca237..3209b53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: 'package.json' - uses: actions/cache@v4 with: path: ~/.npm From f6db78a32d4c8c7c784d97df7055f121ea11fe12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimondas=20Rimkevi=C4=8Dius?= Date: Thu, 23 Apr 2026 03:29:59 +0300 Subject: [PATCH 3/5] infra: give CI workflow and steps descriptive names --- .github/workflows/ci.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3209b53..a04b169 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: Lint and Build on: pull_request: @@ -6,20 +6,29 @@ on: jobs: lint-and-build: + name: Frontend & Worker — lint and build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version-file: 'package.json' - - uses: actions/cache@v4 + - name: Cache npm + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - - run: npm install - - run: npm -w frontend run lint - - run: npm -w worker run lint - - run: npm -w frontend run build - - run: npm -w worker run build + - name: Install dependencies + run: npm install + - name: Lint frontend + run: npm -w frontend run lint + - name: Lint worker + run: npm -w worker run lint + - name: Build frontend + run: npm -w frontend run build + - name: Build worker + run: npm -w worker run build From fcbb8b7317ff7a7fd49cc186419541ee9c2a8168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimondas=20Rimkevi=C4=8Dius?= Date: Thu, 23 Apr 2026 03:31:39 +0300 Subject: [PATCH 4/5] infra: replace ci.yml with updated lint-build.yml --- .github/workflows/ci.yml | 34 ---------------------------- .github/workflows/lint-build.yml | 38 +++++++++++++++++--------------- 2 files changed, 20 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index a04b169..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Lint and Build - -on: - pull_request: - branches: [main] - -jobs: - lint-and-build: - name: Frontend & Worker — lint and build - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: 'package.json' - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install dependencies - run: npm install - - name: Lint frontend - run: npm -w frontend run lint - - name: Lint worker - run: npm -w worker run lint - - name: Build frontend - run: npm -w frontend run build - - name: Build worker - run: npm -w worker run build diff --git a/.github/workflows/lint-build.yml b/.github/workflows/lint-build.yml index 2392f4a..a04b169 100644 --- a/.github/workflows/lint-build.yml +++ b/.github/workflows/lint-build.yml @@ -1,32 +1,34 @@ -name: CI +name: Lint and Build on: pull_request: branches: [main] - push: - branches: [main] jobs: - build: + lint-and-build: + name: Frontend & Worker — lint and build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version-file: package.json - + node-version-file: 'package.json' + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- - name: Install dependencies run: npm install - - name: Lint frontend - run: npm run lint -w frontend - continue-on-error: true - + run: npm -w frontend run lint + - name: Lint worker + run: npm -w worker run lint - name: Build frontend - run: npm run build -w frontend - continue-on-error: true - + run: npm -w frontend run build - name: Build worker - run: npm run build -w worker - continue-on-error: true + run: npm -w worker run build From 21a82331a2eb9806b69ee74888daff15aca1de6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimondas=20Rimkevi=C4=8Dius?= Date: Thu, 23 Apr 2026 03:32:20 +0300 Subject: [PATCH 5/5] infra: add Cloudflare Worker deploy workflow on push to main --- .github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7b5e164 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy Worker + +on: + push: + branches: [main] + paths: + - 'worker/**' + - 'package.json' + - 'package-lock.json' + +jobs: + deploy: + name: Deploy to Cloudflare Workers + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'package.json' + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies + run: npm install + - name: Deploy worker + run: npm -w worker run deploy + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}