stages: - build - deploy - refresh 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 refresh-elo: stage: refresh image: python:3.12-slim variables: GIT_STRATEGY: clone script: - cd statcheck-elo-scraper && python refresh_elo.py && cd .. - 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 public/elo-data.json - | if ! git diff --cached --quiet; then git commit -m "data: refresh stat-check ELO rankings [skip ci]" git push origin HEAD:main fi only: - schedules