Overview
Prequel offers GitHub Actions to automate updates to your models and products based on.json config files stored in your GitHub repo.
Use these to:
- Keep your model/product configs version-controlled
- Automatically sync changes to Prequel on every commit
- Define your data contract directly in code
Supported actions
You can use the following GitHub Actions provided by Prequel:prequel-co/apply-model-configs@v1, upserts modelsprequel-co/apply-product-configs@v1, upserts products
production environment in Prequel. To set up an action that will update staging configs, update the branches field to point to your staging branch, and pass it your PREQUEL_STAGING_API_KEY instead of the production one.
prequel_cd.yaml
Model config format
Model config files live in your repo. The default locationsprequel/models/*.json and prequel/products/*.json can be overwritten with the dir field). Each file describes one model and is passed into the apply-model-configs action. Data model configuration is documented in full below.
example_model_config.json
Tip: Using
source_name instead of source_id provides stability across both staging and prod environments, whereas source_id is environment-specific.Product config format
Product config files live in your repo (e.g.prequel/products/*.json) and define which models are grouped together into a “product” for sync. Each file defines one product. Product configuration is documented in more detail below.
transactions_product.json
Currently, you cannot attach a model to a product from the model config itself, products must reference the model explicitly using this method.
FAQ
Can I use branch names to isolate models per environment?
Can I use branch names to isolate models per environment?
Yes. A common pattern is to override
model_name based on branch name to prevent collisions. This can be done using custom scripting in your workflow or naming conventions in your files.Where should I store these config files?
Where should I store these config files?
These should live in your GitHub repo (e.g.,
prequel/models/*.json, prequel/products/*.json). They are pulled by the GitHub Action and applied to Prequel automatically.