jojapicom/deploy-action GitHub Action: every pull request gets a preview deployment with its own URL, commented on the pull request, and every merge to your default branch goes to production. Each deployment records its commit, branch and pull request, so the Deployments tab links straight to the code it runs.
Set up
- Put the Worker in the repository.
npx @jojapi/cli pull <your-api>writes the files and ajojapi.jsonthat names the API. Commit both. Files undersrc/and npm dependencies are bundled by the CLI. - Create a Management API token in the Studio (Management API) with the
code:readandcode:writescopes. - Add it to the repository as the secret
JOJAPI_TOKEN(Settings → Secrets and variables → Actions) by pasting the value. Withgh secret set JOJAPI_TOKEN, paste it at the prompt: piping an unset shell variable into it stores an empty secret without an error, and the deploy then fails with “The token input is empty”. - Add the workflow below as
.github/workflows/jojapi.yml.
package-lock.json, runs jojapi deploy and sets the outputs status, url, deployment-id, deployment-number, preview-url and promoted for later steps. Its README lists every input: working-directory, production, message, comment and more.
What happens
A failed build or upload fails the job with the error (also shown in the pull request comment), and production stays as it was. Roll back from the Deployments tab or with
npx @jojapi/cli rollback.
An API still in template mode switches to code mode with its first deploy. A pull request’s preview leaves production on the template’s deployment until the merge; Back to template in the Studio restores the template.
Several APIs in one repository
Give each API its own folder with itsjojapi.json and one action step per folder, each with its own working-directory (for example apis/search). Each API keeps its own pull request comment. A folder whose files did not change deploys nothing.
The CLI in scripts
jojapi deploy --json prints one line of JSON for scripts:
--message overrides the description taken from the commit or pull request title.