ci: move POS (Windows, 2x multiplier) to tag/manual only; document budget

Each push previously burned ~21 billable GitHub Actions minutes because the
Windows POS build cost 10 (5 real × 2x Windows multiplier). That gives us
~95 pushes/month on the 2000-minute free tier — too tight for active dev.

- POS job now gates on `startsWith(github.ref, 'refs/tags/v')` OR
  workflow_dispatch. Every-commit CI stays Linux-only.
- CI trigger adds `tags: ['v*']` and workflow_dispatch so releases can build
  the .exe on demand.
- docs/24x7.md: new table with per-job minute/multiplier breakdown and the
  break-even point where a self-hosted runner becomes cheaper (~200 commits/mo).

Post-change estimate: ~11 billable min/commit → fits 180 commits/month in
the free tier. Windows minutes only spent when tagging a release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
nurdotnet 2026-04-22 11:36:29 +05:00
parent 5bcbff66de
commit fa2fae9503
2 changed files with 19 additions and 0 deletions

View file

@ -3,8 +3,10 @@ name: CI
on: on:
push: push:
branches: [main] branches: [main]
tags: ['v*']
pull_request: pull_request:
branches: [main] branches: [main]
workflow_dispatch:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@ -78,8 +80,11 @@ jobs:
path: src/food-market.web/dist path: src/food-market.web/dist
retention-days: 14 retention-days: 14
# POS build costs 2x Windows minutes — run only on tags / manual trigger,
# not on every commit. Releases are built from tags anyway.
pos: pos:
name: POS (WPF, Windows) name: POS (WPF, Windows)
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -68,6 +68,20 @@
- БД: ежедневный pg_dump `.sql.gz`, 30 дней ротации, скрипт `deploy/backup.sh`. - БД: ежедневный pg_dump `.sql.gz`, 30 дней ротации, скрипт `deploy/backup.sh`.
- Критические операции (миграции с удалением данных, force-push на main) — всегда спрошу тебя. - Критические операции (миграции с удалением данных, force-push на main) — всегда спрошу тебя.
## GitHub Actions бюджет (free: 2000 мин/мес на приватный репо)
| Job | Runner | Мин/запуск | Множитель | Биллинговых мин | Когда |
|---|---|---|---|---|---|
| backend | Linux | 3 | 1× | 3 | каждый push/PR |
| web | Linux | 2 | 1× | 2 | каждый push/PR |
| pos | Windows | 5 | 2× | 10 | **только на теги `v*` + ручной запуск** |
| docker-api | Linux | 3 | 1× | 3 | только push в main (с изм. кода) |
| docker-web | Linux | 3 | 1× | 3 | только push в main (с изм. кода) |
**Оценка:** ~11 бил.мин на обычный коммит. Лимит 2000 мин ≈ 180 коммитов в месяц или 6 в день. На теге релиза +10 за POS.
**Когда упрёмся (ориентир: 200+ коммитов/мес):** поднимем self-hosted runner на Proxmox-VM (Ubuntu, 2 CPU/2 GB). В workflow: `runs-on: [self-hosted, linux]` вместо `ubuntu-latest`. Безлимит по времени.
## Что нужно для полноценного 24/7 (ещё не сделано) ## Что нужно для полноценного 24/7 (ещё не сделано)
- [x] GitHub Actions для CI (backend/web/POS) — готов `.github/workflows/ci.yml` - [x] GitHub Actions для CI (backend/web/POS) — готов `.github/workflows/ci.yml`