image: node:20-alpine

stages:
  - deploy

deploy_cloudflare_pages:
  stage: deploy
  script:
    - npm install -g wrangler
    # Deploy the current directory (.) to Cloudflare Pages
    - wrangler pages deploy . --project-name $CLOUDFLARE_PROJECT_NAME --branch $CI_COMMIT_BRANCH
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
