---
title: Continuous Delivery
description: Discover Storyblok's documentation with comprehensive developer guides, user manuals, API references, and examples to help you get the most out of the headless CMS platform.
url: https://storyblok.com/docs/plugins/field-plugins/continuous-delivery
---

# Continuous Delivery

Follow the instructions below to set up a continuous delivery pipeline that ensures that the latest stable version of your field plugin is deployed to production. The provided examples use GitHub Actions but could be reproduced for your platform of choice.

The `package.json` created by the [@storyblok/field-plugin-cli](https://www.npmjs.com/package/@storyblok/field-plugin-cli) contains `build` and `deploy` scripts. These can be utilized to create a workflow that:

1.  builds the application whenever code is pushed to the remote repository
2.  deploys the changes to Storyblok

## Build workflow

Create a new `.yml` file in `.github/workflows/`, for example `.github/workflows/deploy.yml`.

```bash
name: Continuous Delivery

on: push

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: 'yarn'
      - name: Install
        run: yarn install
      - name: Build
        run: yarn build
```

This will build the field plugin whenever a commit is pushed. If you want to include any other steps, such as tests, type checks, code formatting, and linting, this is a great place to put them.

## Deploy workflow

Field plugins are deployed with the CLI which requires a Storyblok personal access token. [Issue a personal access token](https://app.storyblok.com/#/me/account?tab=token) and add it as an environment variable `STORYBLOK_PERSONAL_ACCESS_TOKEN` to your CI/CD configuration. In GitHub, you can [configure the token as a secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).

Add a second job to your workflow configuration file:

```bash
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    needs: check
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: 'yarn'
      - name: Install
        run: yarn install
      - name: Build and Deploy
        env:
          STORYBLOK_PERSONAL_ACCESS_TOKEN: ${{secrets.STORYBLOK_PERSONAL_ACCESS_TOKEN}}
        run: yarn deploy --skipPrompts --name training-field --scope partner-portal
```

This job will execute only if the build completed successfully (including optional additional checks), and the workflow was triggered by a push to the main branch.

In the last step, the field plugin is deployed with the CLI. Because the workflow is triggered programmatically, the `deploy` command executes in a non-interactive mode with the `--skipPrompts` option, so that the workflow does not wait for user input. The access token specified in the environmental variable `STORYBLOK_PERSONAL_ACCESS_TOKEN` is used.

Change the `--name` option to the name of your field plugin.

> [!WARNING]
> WARNING: If you do not specify the name with the `--name` option, the Field Plugin CLI will implicitly assume the name from `package.json`. If someone at any point would change the `name` in `package.json`, it could have unexpected consequences in the CI/CD pipeline.

Finally, set the `--scope` to `my-plugins`, `partner-portal`, or `organization`.

## Preview URLs

When submitting code for review, it is convenient to share a preview URL that lets the reviewer see the changes in action.

With Netlify, [import your site from an existing repository](https://docs.netlify.com/welcome/add-new-site/#import-from-an-existing-repository). With Vercel, [import an project from GitHub](https://vercel.com/docs/concepts/get-started/deploy#import-an-existing-project). In either case, your pull requests on GitHub will receive automated comment including a preview URL.

## Pagination

-   [Previous: Distribution](/docs/plugins/field-plugins/distribution)
-   [Next: Examples](/docs/plugins/field-plugins/examples)
