Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
node_modules/
.drone.yml
.git/
.env
.env.example
.eslintrc.json
.gitignore
LICENSE
README.md
keys/
eslint.config.js
scripts/
test/
.github/
24 changes: 0 additions & 24 deletions .eslintrc.json

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [master, modernization]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Build Docker image (amd64)
run: docker build --platform linux/amd64 -t chorebot:ci .
19 changes: 0 additions & 19 deletions .github/workflows/deploy-dev.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/main.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/master-pr-check-version.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ typings/
.next

keys/

# Deploy secrets
scripts/config.sh
24 changes: 20 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
FROM node:12-alpine
FROM node:24-alpine

WORKDIR /usr/src/app

COPY . /usr/src/app/
RUN npm install
ENV NODE_ENV=production

COPY package*.json ./
RUN npm ci --omit=dev

COPY server.js ./
COPY utilities/ ./utilities/

EXPOSE 3000

CMD ["npm", "start"]
# The Google service-account key (keys/sheets-api.json) is NOT baked into the
# image — mount it at runtime, e.g.:
# -v /host/sheets-api.json:/usr/src/app/keys/sheets-api.json:ro
#
# NOTE: runs as root so the mounted key is readable regardless of volume
# ownership (matching prior behavior). Running non-root + moving the key off
# disk (Workload Identity / injected secret) is a recommended follow-up.

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://127.0.0.1:3000/health >/dev/null 2>&1 || exit 1

CMD ["node", "server.js"]
32 changes: 32 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const js = require("@eslint/js");
const globals = require("globals");

module.exports = [
js.configs.recommended,
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "commonjs",
globals: {
...globals.node,
},
},
rules: {
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"no-console": "off",
"no-var": "warn",
"no-case-declarations": "off",
},
},
{
files: ["test/**/*.js"],
languageOptions: {
globals: {
...globals.jest,
},
},
},
];
Loading
Loading