Skip to main content

CI Integration

Integrate with CI

You can use your unique access token to update projects with continuous integration (CI) systems:

First, generate your access token on local after logged in.

$ dbdocs token -g
✔ Verify your identity
✔ Your access token is: eyJhbGciOi...
› Warning: Please save this token. You cannot see it again.

Then add DBDOCS_TOKEN as a new environment variable in your CI machine.

DBDOCS_TOKEN=eyJhbGciOi....

It's done! Now you can run dbdocs build command on your CI without login actions.

$ dbdocs build <path to your dbml file>/Ecommerce.dbml

GitHub's Action example

You can try it out with our GitHub's Action quick setup

name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install dbdocs
run: sudo npm install -g dbdocs

- name: Check dbdocs
run: dbdocs

- name: Update dbdocs project
env:
DBDOCS_TOKEN: eyJhbGciOi...
run: dbdocs build ./ecommerce.dbml

Revoke Access Token

Remove your existing token with this command:

$ dbdocs token -r
✔ Verify your identity
✔ Your access token has been revoked