Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate Locales
run: pnpm validate-locales

- name: Check Formatting
run: pnpm format:check

- name: Type check
run: pnpm exec tsc --noEmit

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy-vps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ jobs:
port: ${{ env.VPS_SSH_PORT }}
script: |
cd ~/projects/DevImpact || cd /app || exit 1
git fetch origin main
git reset --hard origin/main
bash ops/deploy/deploy-leaderboard.sh
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec commitlint --edit "$1"
3 changes: 3 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {

Check warning on line 1 in commitlint.config.mjs

View workflow job for this annotation

GitHub Actions / Validate (Node 24.x)

Assign object to a variable before exporting as module default

Check warning on line 1 in commitlint.config.mjs

View workflow job for this annotation

GitHub Actions / Validate (Node 24.x)

Assign object to a variable before exporting as module default
extends: ["@commitlint/config-conventional"],
};
17 changes: 14 additions & 3 deletions ops/deploy/deploy-leaderboard.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail

# Determine script directory and path to compose file
# Determine script directory, project root, and compose file
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
COMPOSE_FILE="${SCRIPT_DIR}/../docker/leaderboard-compose.yml"
ENV_FILE="${PROJECT_ROOT}/.env"

echo "=================================================="
echo " DevImpact Leaderboard Worker Deployment"
echo "=================================================="
echo "Project Root: ${PROJECT_ROOT}"
echo "Compose File: ${COMPOSE_FILE}"

if [ ! -f "${COMPOSE_FILE}" ]; then
echo "Error: Compose file not found at ${COMPOSE_FILE}" >&2
exit 1
fi

ENV_ARGS=()
if [ -f "${ENV_FILE}" ]; then
echo "Env File: ${ENV_FILE} (found)"
ENV_ARGS+=(--env-file "${ENV_FILE}")
else
echo "Warning: .env file not found at ${ENV_FILE}. Proceeding with system environment..." >&2
fi

echo "[1/3] Pulling latest GHCR image..."
docker compose -f "${COMPOSE_FILE}" pull
docker compose --project-directory "${PROJECT_ROOT}" "${ENV_ARGS[@]}" -f "${COMPOSE_FILE}" pull

# Check if worker container is running and an active calculation is in progress
CONTAINER_NAME="devimpact-leaderboard-cron"
Expand All @@ -33,7 +44,7 @@ else
fi

echo "[3/3] Recreating leaderboard worker container with new image..."
docker compose -f "${COMPOSE_FILE}" up -d --remove-orphans
docker compose --project-directory "${PROJECT_ROOT}" "${ENV_ARGS[@]}" -f "${COMPOSE_FILE}" up -d --remove-orphans

echo "=================================================="
echo " Leaderboard Worker Deployed Successfully!"
Expand Down
16 changes: 0 additions & 16 deletions ops/docker/leaderboard-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,5 @@ services:
- path: ${ENV_FILE:-../../.env}
required: false
environment:
GITHUB_TOKEN: ${GITHUB_TOKEN}
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
REDIS_ENABLED: ${REDIS_ENABLED:-false}
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_CACHE_NAMESPACE: ${REDIS_CACHE_NAMESPACE:-devimpact:v1}
REDIS_CACHE_TTL_SECONDS: ${REDIS_CACHE_TTL_SECONDS:-604800}
REDIS_CONNECT_TIMEOUT_MS: ${REDIS_CONNECT_TIMEOUT_MS:-1500}
LEADERBOARD_CRON_SCHEDULE: ${LEADERBOARD_CRON_SCHEDULE:-0 0 * * *}
LEADERBOARD_SOURCE_URL_TEMPLATE: ${LEADERBOARD_SOURCE_URL_TEMPLATE:-https://raw.githubusercontent.com/ashkulz/committers.top/gh-pages/_data/locations/{country}.yml}
LEADERBOARD_SEED_LIMIT: ${LEADERBOARD_SEED_LIMIT:-256}
LEADERBOARD_REFRESH_LIMIT: ${LEADERBOARD_REFRESH_LIMIT:-500}
LEADERBOARD_USER_STALE_DAYS: ${LEADERBOARD_USER_STALE_DAYS:-30}
GITHUB_USER_STALE_DAYS: ${GITHUB_USER_STALE_DAYS:-14}
GITHUB_REPO_COUNT: ${GITHUB_REPO_COUNT:-30}
GITHUB_PR_COUNT: ${GITHUB_PR_COUNT:-80}
GITHUB_ISSUE_COUNT: ${GITHUB_ISSUE_COUNT:-20}
GITHUB_DISCUSSION_COUNT: ${GITHUB_DISCUSSION_COUNT:-10}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"tailwind-merge": "^2.5.3"
},
"devDependencies": {
"@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.2",
"@types/js-yaml": "^4.0.9",
"@types/node": "^25.5.2",
"@types/pg": "^8.20.0",
Expand Down
Loading
Loading