---
title: 'Developer guide: CI plugins'
summary: null
url: >-
  https://www.fastly.com/documentation/guides/integrations/non-fastly-services/developer-guide-ci
---

Applications written for [Compute services](https://www.fastly.com/documentation/guides/compute) can be compiled and tested outside the Fastly platform in many popular CI tools such as Jenkins, CircleCI or GitHub Actions. We have our own [GitHub actions for Fastly](https://www.fastly.com/documentation/guides/integrations/non-fastly-services/developer-guide-ci#github-actions), described below, or just [use the Fastly CLI](https://www.fastly.com/documentation/guides/integrations/non-fastly-services/developer-guide-ci#using-the-fastly-cli-in-ci) in other environments.

Code written for [VCL services](https://www.fastly.com/documentation/guides/full-site-delivery/fastly-vcl) can only be compiled by Fastly. As a result the value of running automations for VCL services is lower, and while there are no tools created specifically to assist with automating processes relating to VCL services, many Fastly customers use [Terraform](https://www.terraform.io/) or other orchestration tools to manage Fastly services, and those tools often have excellent support for running in CI environments. [Learn more about using orchestration tools with Fastly](https://www.fastly.com/documentation/guides/integrations/non-fastly-services/developer-guide-terraform).

## GitHub Actions

GitHub Actions is a popular tool for running tasks on repositories in response to events such as pull requests being opened or merged. You can create workflows in GitHub Actions similarly to other CI tools by configuring the workflow to install and run the Fastly CLI, however we have created a set of [pre-packaged workflows](https://github.com/fastly/compute-actions) which make building and deploying Compute applications easier.

To compile and deploy a Compute service at the root of the repository, you can use the `fastly/compute-actions` main action. The following workflow will install the Fastly CLI, build your project (with dependencies and toolchains for the appropriate language), and deploy it to your Fastly service:

### Rust

```yml
name: Deploy Application
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Install Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
          target: wasm32-wasip1 # WebAssembly target

    - name: Deploy to the Compute platform
      uses: fastly/compute-actions@v5
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
```

### Javascript

```yml
name: Deploy Application
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Install project dependencies
      run: npm install

    - name: Deploy to the Compute platform
      uses: fastly/compute-actions@v5
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
```

### Go

```yml
name: Deploy Application
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Install Go toolchain
      uses: actions/setup-go@v5
      with:
          go-version: "1.23"

    - name: Deploy to the Compute platform
      uses: fastly/compute-actions@v5
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
```

### Custom Workflows

Alternatively, you can manually run the individual GitHub Actions for the Compute platform if you want finer control over your workflow:

- `fastly/compute-actions/setup` - Download the Fastly CLI if not already installed
- `fastly/compute-actions/build` - Build a Compute project. Equivalent to <kbd>fastly compute build</kbd>
- `fastly/compute-actions/deploy` - Deploy a Compute project. Equivalent to <kbd>fastly compute deploy</kbd>
- `fastly/compute-actions/preview` - Deploy a Compute project to a new Fastly Service, which is deleted when the pull-request is merged or closed.

For example, each time you open or update a pull request, you could create a temporary Fastly service to run the Compute application using the code updated in the PR, so you can test out the proposed change on the live Fastly platform before you merge the PR:

```yml
name: Fastly Compute Branch Previews
concurrency:
  group: ${{ github.head_ref || github.run_id }}-${{ github.workflow}}
on:
  pull_request:
    types: [opened, synchronize, reopened, closed]
jobs:
  deploy:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@v4
      - uses: fastly/compute-actions/preview@v5
        with:
          fastly-api-token: ${{ secrets.FASTLY_API_TOKEN }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
```

See the [full documentation on GitHub](https://github.com/fastly/compute-actions) for the actions for more examples and details about each of the possible input properties.

## Using the Fastly CLI in CI

Nearly any CI environment can run the [Fastly CLI](https://www.fastly.com/documentation/reference/tools/cli), and it's a great way to automate the process of building and deploying Compute apps. To validate that your code builds, use <kbd>fastly compute build</kbd> and to deploy, <kbd>fastly compute publish</kbd>.

The `--non-interactive` flag can be used with many CLI commands to suppress prompts and ensure the process does not hang.
