when: - event: push branch: [main] - event: manual steps: - name: build image: node:22 commands: - npm ci - npm run test - PUBLIC_GLITCHTIP_RELEASE=$CI_PIPELINE_NUMBER npm run build - name: upload-sourcemaps image: rust:1 environment: SENTRY_URL: from_secret: glitchtip_url SENTRY_AUTH_TOKEN: from_secret: glitchtip_auth_token SENTRY_ORG: from_secret: glitchtip_org SENTRY_PROJECT: from_secret: glitchtip_project commands: - cargo install --locked --git https://gitlab.com/glitchtip/glitchtip-cli.git - glitchtip-cli sourcemaps inject ./dist - glitchtip-cli sourcemaps upload ./dist --release "$CI_PIPELINE_NUMBER" - name: deploy image: node:22 environment: CLOUDFLARE_API_TOKEN: from_secret: cloudflare_api_token CLOUDFLARE_ACCOUNT_ID: from_secret: cloudflare_account_id commands: - npx wrangler pages deploy ./dist --project-name halfstreet-io --branch $CI_COMMIT_BRANCH - name: notify-success image: curlimages/curl:latest environment: PUSHOVER_TOKEN: from_secret: pushover_token PUSHOVER_USER: from_secret: pushover_user commands: - | curl -sS --fail-with-body \ --form-string "token=$PUSHOVER_TOKEN" \ --form-string "user=$PUSHOVER_USER" \ --form-string "title=halfstreet.io deployed" \ --form-string "message=Build $CI_PIPELINE_NUMBER succeeded on $CI_COMMIT_BRANCH — $CI_COMMIT_MESSAGE" \ --form-string "priority=0" \ --form-string "url=$CI_PIPELINE_URL" \ --form-string "url_title=View build" \ https://api.pushover.net/1/messages.json when: - status: success - name: notify-failure image: curlimages/curl:latest environment: PUSHOVER_TOKEN: from_secret: pushover_token PUSHOVER_USER: from_secret: pushover_user commands: - | curl -sS --fail-with-body \ --form-string "token=$PUSHOVER_TOKEN" \ --form-string "user=$PUSHOVER_USER" \ --form-string "title=halfstreet.io build failed" \ --form-string "message=Build $CI_PIPELINE_NUMBER failed on $CI_COMMIT_BRANCH — $CI_COMMIT_MESSAGE" \ --form-string "priority=1" \ --form-string "url=$CI_PIPELINE_URL" \ --form-string "url_title=View build" \ https://api.pushover.net/1/messages.json when: - status: failure