Skip to main content

arc deploy

Deploy the game.

Usage​

arc deploy [method] [options]

Positionals:
method Deploy method [string] [choices: "direct", "git"] [default: "direct"]

Options:
-w, --wait Wait until it's published or fails [boolean] [default: true]
--timeout Seconds to wait [number] [default: 300, or 900 for git]
-j, --json Format output as JSON [boolean] [default: false]
-q, --quiet Output only errors [boolean] [default: false]
-C, --cwd Set the working directory [string] [default: "."]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Description​

Publishes the current version of the project. It validates, builds, packages, and publishes in one step.

arc deploy        # build and deploy from this machine
arc deploy git # tag a release and let GitHub Actions build it

Both methods start by validating the project, and abort on any issue (N issues found.). A warning, such as an unknown field, or a .env file in what direct packs, is printed, and the deploy goes on. Its own checks are of the release (a published version, and for git, the repository); the project's are arc validate's, and the package's arc pack's, each shown as it says them.

Each version can be published once, so bump version after each published build. A version is taken once its build is made: if the upload or Arcadible's processing fails before that, deploy the same version again, after 5 minutes (deploy_rate_limited). Both methods refuse a version that's already published, and say what's newest on each channel and what to bump to:

$ arc deploy
Deploy aborted.
Version 1.2.0 is already published.

Production: 1.2.0
Staging: 1.2.0-beta.3

Bump the version, for example to 1.2.1.

A prerelease version, like 1.2.0-beta.1, is published to the staging channel, and any other version to production. See Channels, and Limits for how often you can deploy.

Both methods then wait for the release until it's published or fails, and say which. When a release fails, Arcadible emails the game's owner why, and when a build is published, its version and channel, unless they've turned that off in Studio's Settings ▸ Notifications.

direct​

The default method. It builds and uploads from your machine:

  1. Checks that you're logged in (Not logged in.). An expired session is refreshed first, and when it can't be, the deploy aborts with Session ended: it expired, or its account was deleted. Both say to run arc login.
  2. Checks that the id and handle aren't used by another game: an id that's another account's is refused as game_not_found, and a handle another game has, or one held for another account, as game_handle_taken. A handle the handle limits hold back from this release warns (game_handle_quota_full, game_handle_lapsed), and the deploy goes on without it. Then checks that this version hasn't been published (Version … is already published.), and warns of each secret your function declares that has no value on the version's channel (secret_unset).
  3. Runs workflow.build and bundles your function, as arc build does, warning of a package a function doesn't use (function_import_wrong), then validates the project again (it doesn't install dependencies: run npm install, or your package manager's install, first), since a build can write files the manifest reads, such as art (N issues found after the build.).
  4. Packages deploy_dir, .arcadible/, and the resolved manifest into a zip, within Arcadible's size limits.
  5. Uploads the zip, with a progress bar. Arcadible refuses a game that was deleted or belongs to another account (Game not found: …); give id a new UUID to deploy it as a new game.
  6. Waits until Arcadible has published it. See Releases for how long that takes.

It then says which channel the build went to, and where it is:

$ arc deploy
Published v1.2.0 to production.

Store:
https://arcadible.com/play/star-drift

Play:
https://play.arcadible.com/star-drift/

When it ran workflow.build, or bundled a function, first, the heading says so: Built and published v1.2.0 to production. With --no-wait, it stops after the upload: the heading is Submitted v1.2.0 to production. (or Built and submitted …), and the last line says Arcadible publishes it once it's processed.

A prerelease goes to staging, with its staging link, such as https://play.arcadible.com/star-drift:staging/, and no store link, since the store shows only production. With --json, the same details are printed as { "built": true, "channel": "production", "play_url": "https://play.arcadible.com/star-drift/", "store_url": "https://arcadible.com/play/star-drift", "version": "1.2.0", "warnings": [] }, with "built": false when there's no build command and no function, and "store_url": null for a prerelease. version is the version deployed, and play_url and store_url its pages. Once it has waited, it adds the release.

git​

Builds in CI from a tagged commit instead of on your machine, so every release maps to a commit. It doesn't need you to be logged in, and doesn't use your login when you are: anyone who can push to the repository can release the game, which is how a team shares deploys, so it checks and reports the same for whoever runs it.

It needs the game deployed once with arc deploy, its repository connected in Arcadible Studio, and the release workflow. See Set it up.

Only direct changes what's the owner's to decide: the game's handle, its function's outbound_hosts, and its server_origins. A release from GitHub that would change one fails (game_handle_changed, servers_changed).

arc deploy git:

  1. If there's a package.json, requires a lockfile (package-lock.json, npm-shrinkwrap.json, pnpm-lock.yaml, or yarn.lock).
  2. Requires a Git repository whose root is the project, since the release workflow builds from there (project_not_repo_root), with no uncommitted changes: staged, unstaged, or untracked files that aren't ignored. The release is built from HEAD, so uncommitted work wouldn't be part of it.
  3. Requires the release workflow, .github/workflows/arcadible-release.yml, in HEAD.
  4. Requires origin to be reachable, and the tag arcadible/release/v<version> not to exist, locally or on origin.
  5. Checks that the game is on Arcadible (… isn't on Arcadible yet.), that this version isn't published, and that handle is the game's (The handle in arcadible.toml is …, then the game's on Arcadible), since only direct changes a handle. These lookups are public, so they need no login. If Arcadible can't be reached, it warns (version_unchecked) and continues.
  6. Checks that origin is the repository connected to the game in Arcadible Studio (… isn't <game>'s repository on Arcadible.). This lookup is public too, and asks about origin by name, so it checks whoever pushes. If origin is a path on your machine, or Arcadible can't be reached, it continues.
  7. Creates the annotated tag arcadible/release/v<version> on HEAD and pushes it to origin.
  8. Waits while GitHub Actions builds it and Arcadible publishes it, then says Published v1.2.0 to production. with its links, as direct does. Anyone can wait, logged in or not: a release says whether it's published or failed, and why, to anyone, with the link to the game in Arcadible Studio, which asks you to log in.

With --no-wait, it prints the tag it pushed, and where the build will be:

$ arc deploy git
Pushed arcadible/release/v1.2.0 to origin.

Store:
https://arcadible.com/play/star-drift

Play:
https://play.arcadible.com/star-drift/

GitHub Actions builds it, then Arcadible publishes it to production.

With --json, it prints the same details as direct, plus the tag and without built.

The push triggers the repository's release workflow, which builds the game and attaches it to a GitHub Release for Arcadible to publish. See What the workflow does. To make git your default, set method = "git" under [deploy] in arc.config.toml.

Waiting for the release​

By default, arc deploy waits until Arcadible has published the release or it has failed, so you know right away, and so does CI: it exits with 1 when the release fails. Pass --no-wait, or set it in arc.config.toml, to stop once the zip is uploaded or the tag is pushed:

arc.config.toml
[deploy]
wait = false

A failed release says why, and what to do about it:

$ arc deploy
Release failed.
The zip couldn't be read.
Run `arc pack` and check it opens.

Arcadible Studio:
https://studio.arcadible.com/games/3f0c9a52-8d1e-4f7b-9a26-5b1c0e7d4a18/builds

Code: zip_invalid
https://developer.arcadible.com/references/errors#zip_invalid

Its code is the release's reason, one of a fixed set. Each one, and how to fix it, is in Release failure reasons.

It waits up to 5 minutes for direct and 15 for git, which also waits for GitHub Actions; change it with --timeout <seconds>, a number above 0, else it's refused before anything is sent (argument_invalid). When the time runs out, it exits with 1 and says the release may still finish, with where to see it. For git, if no release has appeared, GitHub Actions is still releasing it or its workflow failed, so it points to the repository's Actions page. If the workflow passed, the Arcadible check on the tagged commit says why Arcadible didn't take it; with no Arcadible check, Arcadible never heard of the release, so it points to the game's Repository tab in Arcadible Studio too, then says to deploy a new version, or prints the commands that delete the tag, to deploy this one again.

While a git deploy waits for its release to appear, it checks again that origin is still the game's connected repository, with its first look and then every minute. When it isn't, it stops at once with repo_not_connected and exits with 1, rather than waiting out the time for a release that can't come.

Output​

With --json, the result adds the release: { "build": "…", "channel": "production", "id": "…", "message": null, "reason": null, "status": "published", "version": "1.2.0" }. A failed release or a timeout prints the same details with an error next to them: { …, "error": { "code": "…", "docs_url": "…", "message": "…" }, "release": { … } }, with the release's reason and message. Every result lists the deploy's warnings, and an error lists them when there are any, such as an unknown field or a version it couldn't check, in the same shape as arc validate's. A release's status is pending, processing, published, or failed; it only waits on the first two. A failed release's error.code is its reason, and a timeout's is wait_timed_out, whose error.message holds the link to Studio, or, for a git release that hasn't appeared, to the repository's Actions page. When a git deploy times out before its release appears, or stops because its repository isn't connected, release is null.

CodeWhen
0The release was published, or, with --no-wait, uploaded or tag pushed
1Anything else: a check, the build, the upload, or the push failed, the release failed, or the wait timed out

Each message, and what to do about it, is in Errors.