Workflow
Deployment
Once you have built your datafiles, you can deploy them to your CDN or any other static file hosting service.
We recommend that you set up a CI/CD pipeline to automate the build and deployment process, instead of doing it from your local machine.
Steps involved#
When a new Pull Request (branch) is merged, the CI/CD pipeline should cover:
Linting#
Lint all the attributes, segments, feature definitions, global variables, and test specs:
$ npx featurevisor lintTesting#
Test all the features, segments, and global variables:
$ npx featurevisor testBuild the datafiles#
$ npx featurevisor buildCommit the state files#
$ git add .featurevisor/*$ git commit -m "[skip ci] Revision $(cat .featurevisor/REVISION)"Only the state files should be committed as available under .featurevisor directory. The generated datafiles in datafiles directory are ignored from Git.
If a release introduces global variables or requiredFeatures, deploy SDK versions that support them before publishing the new datafiles. Older SDKs may ignore those fields and evaluate a feature or variable without the intended prerequisite.
The same ordering applies when a feature variable override combines requiredFeatures with conditions or segments. Upgrade consumers first, then publish the datafile that depends on the newer evaluation behaviour.
Upload to your CDN#
This step is specific to your CDN provider or custom infrastructure.
You can use the datafiles directory as the root directory for your CDN.
Push commits back to upstream#
We want to make sure the next Pull Request merge will be on top of the latest version and state files.
$ git push origin mainIf any of the steps above fail, the CI/CD pipeline should stop and notify the team.
Fully functional example#
You can refer to the CI/CD guide for GitHub Actions and either Cloudflare Pages or GitHub Pages if you want a fully functional real-world example of setting up a Featurevisor project.
Repo is available here: https://github.com/featurevisor/featurevisor-example-cloudflare.

