# Update and manage modules you created

After you [create and upload a module](https://docs.viam.com/build-modules/write-a-driver-module/), you can release new versions, pin machines to a specific version, set a minimum `viam-server` version, change visibility, deprecate, or delete the module.

## Update a module

Once your module is in the [registry](https://app.viam.com/registry), there are two ways to update it:

- [Update automatically](https://docs.viam.com/build-modules/manage-modules/#update-automatically-from-a-github-repo-with-cloud-build) using GitHub Actions: Recommended for ongoing projects with continuous integration (CI) workflows, or if you want to build for multiple platforms.

- If you enabled cloud build when you generated your module, the GitHub Actions are already set up for you.
- [Update manually](https://docs.viam.com/build-modules/manage-modules/#update-manually) using the [Viam CLI](https://docs.viam.com/cli/): Fine for small projects with one contributor.

### Update automatically from a GitHub repo with cloud build

Use [GitHub Actions](https://docs.github.com/actions) to automatically build and deploy your new module version when you create a new release in GitHub:

1. Edit your module code and update the [`meta.json`](https://docs.viam.com/build-modules/module-reference/) file if needed.  
For example, if you’ve changed the module’s functionality, update the description in the `meta.json` file.

#### Important

Make sure the `url` field contains the URL of the GitHub repo that contains your module code.  
This field is required for cloud build to work.

2. Push your changes to your module GitHub repository.

#### Tip

If you used `viam module generate` to create your module and enabled cloud build, and you followed all the [steps to deploy with cloud build](https://docs.viam.com/build-modules/deploy-a-module/#release-with-cloud-build) including adding API keys for the build action, all you need to do to trigger a new build is publish a release in GitHub as you did when you first published the module.

3. If you did not use the Viam CLI generator and enable cloud build, you can set up one of the following GitHub Actions up manually:

- [build-action (Recommended)](https://docs.viam.com/build-modules/manage-modules/#tabset-build-modulesmanage-modules-1-0)
   - [upload-module](https://docs.viam.com/build-modules/manage-modules/#tabset-build-modulesmanage-modules-1-1)

The `build-action` GitHub action provides a cross-platform build setup for multiple platforms: x86, ARM Linux, and macOS.

In your repository, create a workflow file called build.yml in the .github/workflows directory:

```yaml
on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: viamrobotics/build-action@v1
        with:
          version: ${{ github.ref_name }}
          ref: ${{ github.sha }}
          key-id: ${{ secrets.viam_key_id }}
          key-value: ${{ secrets.viam_key_value }}
          token: ${{ github.token }} # only required for private git repos
```

The `build-action` GitHub action relies on a build command that you need to specify in the meta.json file.  
At the end of your meta.json, add the build configuration:

```json

```

##### Cloud build configuration attributes

| Attribute | Inclusion | Description |
| --- | --- | --- |
| `"setup"` | Optional | Command to run for setting up the build environment. |
| `"build"` | **Required** | Command to run to build the module tarball. |
| `"path"` | Optional | Path to the build module tarball. |
| `"arch"` | **Required** | Array of architectures to build for. For more information see [Supported platforms for automatic updates](https://docs.viam.com/build-modules/manage-modules/#supported-platforms-for-automatic-updates). |
| `"darwin_deps"` | **Required** | Array of homebrew dependencies for Darwin builds. Explicitly pass `[]` for empty. Default: `[
