GitHub Actions
Prequel offers a GitHub Action for adding and updating both model configs and product configs. There current actions are named:
prequel-co/apply-model-configs@v1
prequel-co/apply-product-configs@v1
These actions can be used to create a GitHub workflow to automatically push updates you make in your GitHub repo to Prequel. See the sample below.
Note that the sample is set up to update configs for your 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.
# This is a basic workflow to help you get started with Prequel Actions
name: Prequel Continuous Delivery
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
sync:
name: Sync with Prequel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Upsert Export Models
uses: prequel-co/apply-model-configs@v1
with:
host: https://api.prequel.co
api_key: ${{ secrets.PREQUEL_API_KEY }}
mode: export
dir: prequel/models/*.json
- name: Upsert Export Products
uses: prequel-co/apply-product-configs@v1
with:
host: https://api.prequel.co
api_key: ${{ secrets.PREQUEL_API_KEY }}
mode: export
dir: prequel/products/*.json
# # Example Import config
# - name: Upsert Import Model
# uses: prequel-co/apply-model-configs@v1
# with:
# host: https://dev-datafeed.prequel.co
# api_key: ${{ secrets.ARTHUR_ANDERSEN_API_KEY }}
# mode: import
# dir: prequel/import/models/transactions.json
# - name: Upsert Import Products
# uses: prequel-co/apply-product-configs@v1
# with:
# host: https://dev-datafeed.prequel.co
# api_key: ${{ secrets.ARTHUR_ANDERSEN_API_KEY }}
# mode: import
# dir: prequel/import/products/*.json
Updated about 1 year ago