Skip to content
v2.7

Package and upload the code

How to assemble the function package (folder, .zip or .tar.gz), the entrypoint and the build command, and how to publish from a GitHub repository or from a template.

Each code upload becomes a deployment: Owbase stores the package, runs the build command and, when it succeeds, puts the deployment live. The code arrives in one of three ways:

  • uploaded by you, from the Deployments → Upload code tab or with the CLI (the rest of this page up to After the upload);
  • from a GitHub repository connected in the Git tab: each push becomes a deployment (from Git);
  • from a template in the Owbase catalog, when you create the function (from a template).

In every case, the build uses the function’s entrypoint and build command, and the deployment shows up in the Deployments tab.

A folder, a .zip or a .tar.gz, up to 30 MB:

  • from a folder, node_modules/, .git/, macOS and Windows junk (.DS_Store, ._*, Thumbs.db) and everything the root .gitignore lists are left out. The build reinstalls the dependencies;
  • in a .zip with a single folder at the root, that folder is removed (its content becomes the root), as tar does;
  • symbolic links and paths that leave the root are not accepted.

Minimal structure:

my-function/
├── package.json dependencies (e.g. @owbase/node) and "type": "module"
├── package-lock.json recommended: the build installs exactly these versions
└── src/
└── main.js the entrypoint

The package.json from the complete example is a good starting point.

  • The entrypoint is the file that exports the function (export default async (context) => { … }).
  • The build command runs at the package root, on every deployment. The default, npm install, is enough for JavaScript. For TypeScript, use something like npm install && npm run build and point the entrypoint at the generated file (dist/main.js).

With the owbase CLI, owbase push function packages the function folder with these same rules, uploads it and waits for the build: it is the way to publish from the terminal or CI.

With Activate when ready checked (the default), the deployment goes live as soon as the build finishes. The list shows the status (waiting, building, ready, failed), the build time and the size; Log shows the build output. An older deployment can go live again with Activate.

Connect a GitHub repository to the function and every push publishes on its own. In the function, open the Git tab:

  1. Install on GitHub: installs the Owbase app on your GitHub account or organization. It only reads the code of the repositories you choose and writes each deployment’s status on the commit (✓ or ✗). If the browser blocks the GitHub window, allow pop-ups.
  2. Repository: pick one from the list. It shows the repositories the app can access; to give it access to another one, use Manage access. With the app on more than one account, pick the GitHub account.
  3. Configuration: the production branch (default main) and the root folder (in a monorepo, the folder with the function’s package.json). Use Connect and publish.

Once connected:

  • with Automatic deploy on every push on (the default), a push to the production branch creates a deployment, which goes live when the build passes. Turned off, no push creates a deployment;
  • commits with [skip ci] in the message don’t create a deployment;
  • the Git tab lists the commits with the status of each one’s deployment (live in production, ready, building, failed, queued, canceled, skipped) and shows when the last notice from GitHub arrived. Publish puts a commit in production;
  • Configure → Disconnect stops pushes from creating deployments; the active deployment stays live and the app stays installed on GitHub (remove it there if you want).

The Viewer role only sees the configuration: it can’t install the app or connect repositories.

In Functions, Start from a template opens the Owbase catalog: ready-made functions for common cases, such as a Pix payment webhook from Mercado Pago, a welcome email, a scheduled cleanup, checkout with Stripe, an AI chat and image thumbnails. Each template shows what it does, the code, the variables and the scopes the function receives (View the code on GitHub opens the full code).

  1. Choose the template and use Use this template.
  2. Give it a name and fill in the required variables (secret ones stay hidden).
  3. Use Create and publish: Owbase creates the function with the template’s variables, scopes and trigger (HTTP, event or schedule) and publishes the code.

With the GitHub app installed in the project, the Create a GitHub repository option (on by default) creates a repository on the chosen account, public or private, copies the template into it and connects the function: from then on, every push to main publishes on its own. Without the app, the function is published straight from the template, and you can connect a repository later from Git. To skip templates, Start from scratch takes you to the regular function creation.

Was this page helpful?