← Back to index

Flutter Web Template

Build and deploy Flutter web applications to AWS S3 + CloudFront with Cloudflare DNS. Extends the static web template with Flutter-specific build steps.

Setup

Recommended: External CI/CD Configuration

Go to Settings > CI/CD > General pipelines and set CI/CD configuration file to:

https://gitlab-ci-yaml-template.enouvo.com/flutter-web/.gitlab-ci.yml

Alternative: Include in .gitlab-ci.yml

include:
  - 'https://gitlab-ci-yaml-template.enouvo.com/flutter-web/.gitlab-ci.yml'

Required Variables

VariableDescription
GITLAB_CI_ACCESS_TOKENToken to download ci-scripts (set by admin at group level)
WEB_URLPublic URL for the deployed app

Optional Variables

VariableDefaultDescription
FLUTTER_VERSION3.29.2Flutter SDK version
DIST_DIRECTORY$CI_PROJECT_BUILD_DIR/buildBuild output directory
APP_BUILD_CMDdart run melos build-web-$branch -- -o $DIST_DIRECTORYCustom build command
AWS_BUCKETauto-discovered from WEB_URLS3 bucket name
AWS_OIDC_ROLE_ARNAWS role ARN for OIDC auth

Sentry Sourcemaps

Automatically uploads sourcemaps after build if configured:

VariableDescription
SENTRY_AUTH_TOKENSentry auth token (masked)
SENTRY_ORGOrganization slug
SENTRY_PROJECTProject slug
SENTRY_URLSelf-hosted URL (default: https://sentry.io)

Build Process

  1. Generates version file and changelog
  2. Runs flutter pub get
  3. Executes build command (melos or custom)
  4. Uploads sourcemaps to Sentry (if configured)
  5. Copies output to dist/ and build_artifacts/

Pipeline Stages

testbuilddeploynotify

Skip Variables

SKIP_DEV_BUILD=true
SKIP_STAGING_DEPLOY=true