From 12dafa4f89f7a0aad0770ae8300adcf87d79aa37 Mon Sep 17 00:00:00 2001 From: robobun Date: Sun, 20 Jul 2025 03:46:44 -0700 Subject: [PATCH] Add comprehensive documentation for bun ci command (#21231) Co-authored-by: Claude Bot Co-authored-by: Claude Co-authored-by: Jarred Sumner --- docs/cli/install.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/cli/install.md b/docs/cli/install.md index f2445040a1..ec7bab379c 100644 --- a/docs/cli/install.md +++ b/docs/cli/install.md @@ -245,7 +245,8 @@ linker = "hoisted" ## CI/CD -Looking to speed up your CI? Use the official [`oven-sh/setup-bun`](https://github.com/oven-sh/setup-bun) action to install `bun` in a GitHub Actions pipeline. + +Use the official [`oven-sh/setup-bun`](https://github.com/oven-sh/setup-bun) action to install `bun` in a GitHub Actions pipeline: ```yaml#.github/workflows/release.yml name: bun-types @@ -264,4 +265,33 @@ jobs: run: bun run build ``` +For CI/CD environments that want to enforce reproducible builds, use `bun ci` to fail the build if the package.json is out of sync with the lockfile: + +```bash +$ bun ci +``` + +This is equivalent to `bun install --frozen-lockfile`. It installs exact versions from `bun.lock` and fails if `package.json` doesn't match the lockfile. To use `bun ci` or `bun install --frozen-lockfile`, you must commit `bun.lock` to version control. + +And instead of running `bun install`, run `bun ci`. + +```yaml#.github/workflows/release.yml +name: bun-types +jobs: + build: + name: build-app + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install bun + uses: oven-sh/setup-bun@v2 + - name: Install dependencies + run: bun ci + - name: Build app + run: bun run build +``` + + + {% bunCLIUsage command="install" /%}