New 5th site in the monorepo, following the same shared header/footer/ images pattern as the others. Shows upcoming events for a configurable list of BCP circuits (CONFIG.circuits in sites/events/src/main.js) — adding a circuit is a one-line edit. Data comes from the BCP API (`GET /v1/events?leagueId=<circuitId>`, same auth-free headers the other sites already use) — "circuit" in BCP's frontend URLs maps to `leagueId` in the API, confirmed via /v1/leagues/<id> returning circuitLeague: true. Paginates newest-date- first and stops once a full page has entirely concluded, so it doesn't walk a circuit's whole history just to find the handful of upcoming events. Verified against the live API for all 4 configured circuits before writing this commit. Nav cross-links with scouting only (per request), not the other 3 sites. nginx conf follows the same shared-asset-alias pattern as the rest; TLS/DNS for the new subdomain still need to be provisioned before it can go live (see follow-up). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBzcNkW7JcYipnAX6HfgmK
212 lines
5.6 KiB
YAML
212 lines
5.6 KiB
YAML
stages:
|
|
- build
|
|
- deploy
|
|
- refresh
|
|
|
|
.build_script: &build_script
|
|
- cd sites/${SITE}
|
|
- npm ci
|
|
- npm run build
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# shared assets (images + footer.html) — deployed once to a shared dir that
|
|
# every site's nginx server block points at via `alias`, so a photo/logo
|
|
# update only has to land in one place instead of four.
|
|
# ---------------------------------------------------------------------------
|
|
|
|
deploy:shared:
|
|
stage: deploy
|
|
script:
|
|
- rsync -avz --delete shared/images/ /var/www/domains/gateway-gamers.net/shared/images/
|
|
- rsync -avz shared/footer.html /var/www/domains/gateway-gamers.net/shared/footer.html
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- shared/**/*
|
|
environment:
|
|
name: production/shared
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 40k-rankings
|
|
# ---------------------------------------------------------------------------
|
|
|
|
build:40k-rankings:
|
|
stage: build
|
|
variables:
|
|
SITE: 40k-rankings
|
|
script: *build_script
|
|
artifacts:
|
|
paths:
|
|
- sites/40k-rankings/dist/
|
|
expire_in: 1 hour
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/40k-rankings/**/*
|
|
- shared/**/*
|
|
|
|
deploy:40k-rankings:
|
|
stage: deploy
|
|
needs: ["build:40k-rankings"]
|
|
script:
|
|
- rsync -avz --delete --exclude images --exclude footer.html sites/40k-rankings/dist/ /var/www/domains/gateway-gamers.net/40k-rankings/
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/40k-rankings/**/*
|
|
- shared/**/*
|
|
environment:
|
|
name: production
|
|
url: https://40k-rankings.gateway-gamers.net
|
|
|
|
refresh-elo:
|
|
stage: refresh
|
|
image: python:3.12-slim
|
|
variables:
|
|
GIT_STRATEGY: clone
|
|
script:
|
|
- (cd sites/40k-rankings/statcheck-elo-scraper && python refresh_elo.py)
|
|
- git config user.email "gitlab-ci@gateway-gamers.net"
|
|
- git config user.name "GitLab CI"
|
|
- git remote set-url origin "https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
|
|
- git add sites/40k-rankings/public/elo-data.json
|
|
- |
|
|
if ! git diff --cached --quiet; then
|
|
git commit -m "data: refresh stat-check ELO rankings"
|
|
git push origin HEAD:main
|
|
fi
|
|
only:
|
|
- schedules
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# aos-rankings
|
|
# ---------------------------------------------------------------------------
|
|
|
|
build:aos-rankings:
|
|
stage: build
|
|
variables:
|
|
SITE: aos-rankings
|
|
script: *build_script
|
|
artifacts:
|
|
paths:
|
|
- sites/aos-rankings/dist/
|
|
expire_in: 1 hour
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/aos-rankings/**/*
|
|
- shared/**/*
|
|
|
|
deploy:aos-rankings:
|
|
stage: deploy
|
|
needs: ["build:aos-rankings"]
|
|
script:
|
|
- rsync -avz --delete --exclude images --exclude footer.html sites/aos-rankings/dist/ /var/www/domains/gateway-gamers.net/aos-rankings/
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/aos-rankings/**/*
|
|
- shared/**/*
|
|
environment:
|
|
name: production
|
|
url: https://aos-rankings.gateway-gamers.net
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# kingmaker
|
|
# ---------------------------------------------------------------------------
|
|
|
|
build:kingmaker:
|
|
stage: build
|
|
variables:
|
|
SITE: kingmaker
|
|
script: *build_script
|
|
artifacts:
|
|
paths:
|
|
- sites/kingmaker/dist/
|
|
expire_in: 1 hour
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/kingmaker/**/*
|
|
- shared/**/*
|
|
|
|
deploy:kingmaker:
|
|
stage: deploy
|
|
needs: ["build:kingmaker"]
|
|
script:
|
|
- rsync -avz --delete --exclude images --exclude footer.html sites/kingmaker/dist/ /var/www/domains/gateway-gamers.net/kingmaker/
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/kingmaker/**/*
|
|
- shared/**/*
|
|
environment:
|
|
name: production
|
|
url: https://kingmaker.gateway-gamers.net
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# scouting
|
|
# ---------------------------------------------------------------------------
|
|
|
|
build:scouting:
|
|
stage: build
|
|
variables:
|
|
SITE: scouting
|
|
script: *build_script
|
|
artifacts:
|
|
paths:
|
|
- sites/scouting/dist/
|
|
expire_in: 1 hour
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/scouting/**/*
|
|
- shared/**/*
|
|
|
|
deploy:scouting:
|
|
stage: deploy
|
|
needs: ["build:scouting"]
|
|
script:
|
|
- rsync -avz --delete --exclude images --exclude footer.html sites/scouting/dist/ /var/www/domains/gateway-gamers.net/scouting/
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/scouting/**/*
|
|
- shared/**/*
|
|
environment:
|
|
name: production
|
|
url: https://scouting.gateway-gamers.net
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# events
|
|
# ---------------------------------------------------------------------------
|
|
|
|
build:events:
|
|
stage: build
|
|
variables:
|
|
SITE: events
|
|
script: *build_script
|
|
artifacts:
|
|
paths:
|
|
- sites/events/dist/
|
|
expire_in: 1 hour
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/events/**/*
|
|
- shared/**/*
|
|
|
|
deploy:events:
|
|
stage: deploy
|
|
needs: ["build:events"]
|
|
script:
|
|
- rsync -avz --delete --exclude images --exclude footer.html sites/events/dist/ /var/www/domains/gateway-gamers.net/events/
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
changes:
|
|
- sites/events/**/*
|
|
- shared/**/*
|
|
environment:
|
|
name: production
|
|
url: https://events.gateway-gamers.net
|