Deploying to Tinybird through CI¶
After you create your data project in Git, you can implement continuous integration (CI) workflows to automate interaction with Tinybird.
When you create a project using tb create
, Tinybird generates CI templates you can use in GitHub and GitLab to automate testing and deployment.
The Tinybird Local container is a key part of the CI workflow. See Local container for more information.
CI workflow¶
As you expand and iterate on your data projects, you can continuously validate your changes. In the same way that you write integration and acceptance tests for source code in a software project, you can write automated tests for your API Endpoints to run on each pull or merge request.
A potential CI workflow could run the following steps when you open a pull request:
- Install Tinybird CLI: Sets up dependencies and installs the Tinybird CLI to run the required commands.
- Build project: Checks the datafile syntax and correctness.
- Test project: Runs fixture tests, data quality tests, or both to validate changes.
CI templates¶
The following templates are available for GitHub and GitLab:
name: Tinybird - CI Workflow on: workflow_dispatch: pull_request: branches: - main - master types: [opened, reopened, labeled, unlabeled, synchronize, closed] concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number }} jobs: ci: runs-on: ubuntu-latest defaults: run: working-directory: '.' services: tinybird: image: tinybirdco/tinybird-local:latest ports: - 7181:7181 steps: - uses: actions/checkout@v3 - name: Install Tinybird CLI run: curl -LsSf https://tbrd.co/fwd | sh - name: Build project run: tb build - name: Test project run: tb test run
Next steps¶
- Learn more about deployments.
- Learn about the Local container.
- Learn about datafiles, like .datasource and .pipe files. See Datafiles.
- Browse the Tinybird CLI commands reference. See Commands reference.