stages: - sync - build - deploy # Runs only on scheduled pipelines (every Wednesday via GitLab schedule). # Downloads the stat-check.com ELO Excel sheet, writes public/elo-data.json, # then commits and pushes so a normal build+deploy pipeline picks it up. # Requires CI variable: GITLAB_PUSH_TOKEN (project token, write_repository scope) sync-elo: stage: sync only: - schedules script: - python3 scripts/sync-elo.py - git config user.email ci@gateway-gamers.net - 'git config user.name "GG CI Bot"' - 'git remote set-url origin "https://oauth2:${GITLAB_PUSH_TOKEN}@gl.mando.club/mandalore/40k-rankings.gateway-gamers.net.git"' - git add public/elo-data.json - | if git diff --staged --quiet; then echo "No ELO changes, skipping commit." else git commit -m 'sync: update ELO data' git push origin HEAD:main fi # Build and deploy skip on scheduled pipelines — the robot push above # triggers its own normal pipeline that handles the actual build + deploy. build: stage: build script: - npm ci - npm run build artifacts: paths: - dist/ expire_in: 1 hour only: - main except: - schedules deploy: stage: deploy script: - rsync -avz --delete dist/ /var/www/domains/gateway-gamers.net/40k-rankings/ only: - main except: - schedules environment: name: production url: https://40k-rankings.gateway-gamers.net