# BlueGit CI for Meteors: unit tests, build of build/, FTP deploy of build/. # Group secrets: timftphost, timftpuser, timftppassword, timftproot (protected). # Repo secret: projectftp (protected; Tim set this to $timftproot/meteors). # GEEN mirror --delete: live files mogen niet verdwijnen. # Deployt map build/ (NIET de repo-root). stages: [test, build, deploy] workflow: rules: - if: $CI_COMMIT_TAG != "" when: never - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == "master" - if: $CI_COMMIT_BRANCH =~ /^feature\// unit_tests: stage: test image: node:20-bookworm script: - node --test test/*.test.js build_game: stage: build image: debian:bookworm-slim needs: [unit_tests] script: - apt-get update -qq && apt-get install -y -qq bash ca-certificates >/dev/null - chmod +x src/build.sh - ./src/build.sh - test -f build/game.js - test -f build/framework.js - test -f build/index.html - test -f build/style.css - test -d build/images - test -f build/images/block-ember.png - test -f build/images/flame.png artifacts: paths: - build/ expire_in: 7d ftp_upload: stage: deploy image: debian:bookworm-slim needs: [build_game] resource_group: production environment: name: production url: https://projects.timfalken.com/meteors/ rules: # Alleen master push (protected secrets). Geen feature/MR-deploys. - if: $CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE != "merge_request_event" script: - apt-get update -qy - apt-get install -y --no-install-recommends lftp python3 ca-certificates - python3 ci/deploy_guard.py - python3 ci/deploy.py