Using Devbox in CI/CD with GitHub Actions

1 week ago 5

This guide explains how to use Devbox in CI/CD using GitHub Actions. The devbox-install-action will install Devbox CLI and any packages + configuration defined in your devbox.json file. You can then run tasks or scripts within devbox shell to reproduce your environment.

This GitHub Action also supports caching the packages and dependencies installed in your devbox.json, which can significantly improve CI build times.

The workflow below shows how to use the action to install Devbox, and then run arbitrary commands or Devbox Scripts in your shell.

name: Testing with devbox

on: push

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

- name: Install devbox
uses: jetify-com/devbox-install-[email protected]

- name: Run arbitrary commands
run: devbox run -- echo "done!"

- name: Run a script called test
run: devbox run test

For stability over new features and bug fixes, consider pinning devbox-version. Remember to update this pinned version when you update your local Devbox via devbox version update.

Read Entire Article