Deploy an app
Deploy a repository, choose its apps and branch, and deploy it again after a change.
This guide deploys a GitHub repository and covers the choices you have on the way: which branch, which apps, and which values. For a first deploy with defaults, the Quickstart is shorter. Deployments explains each stage.
Before you start
- A LILY account with a GitHub connection.
- The commit you want to deploy is pushed to GitHub.
- For the CLI:
llyinstalled and signed in. - The examples use an app called
copperfox. The console shows an app by its name. The CLI uses its address name, the first part of the app's address. In the examples both arecopperfox.
Steps
Choose the repository and branch
Start a new project. Paste a repository link, or connect GitHub and pick one of your repositories, private ones included. Choose the branch with the Branch selector. It starts on the default branch.
In a clone of the repository, lly deploy uses the checked-out branch. Name a repository or a branch, tag or commit to deploy something else:
lly deploy # this directory, checked-out branch
lly deploy acme/shop # a repository by name
lly deploy acme/shop --ref release # a branch, tag or commitChoose the apps
LILY looks for apps in the repository root and in the first level of folders such as apps/, packages/ and services/. Each one it finds can become an app.
Select the apps to deploy from the list. Each entry shows its path and framework.
lly shows the list with all supported apps selected. To skip the question, name them:
lly deploy --apps apps/web,services/api
lly deploy --allSet variables and ports
Review the arguments, environment variables and ports of each app. What LILY detected is filled in already. Fill in empty values. Empty variables do not block the deploy.
lly asks for empty values. To set them up front:
lly deploy --env apps/web:NODE_ENV=production --port services/api=8080
lly deploy --env-file apps/web=.env.production--save writes the settings of this run to a lily.toml, so the next deploy needs no flags.
Deploy and follow the build
Check the summary, then deploy. The project canvas shows the status of each app until it is live.
lly follows the build of each app and prints the summary:
Apps
App Phase URL Since
copperfox deployed https://copperfox.lilylabs.app 2m ago
cinderrock deployed (private) 2m agoDeploy again after a change
Push your commit, then deploy again. LILY does not deploy on push.
Select Redeploy in the action bar of the app.
Run the same command again. It redeploys the same apps from the latest commit and skips selection and configuration.
lly deployCheck that it worked
Each public app answers at https://<slug>.lilylabs.app. lly ls lists the apps with their state.
If it does not work
| What you see | Cause | Fix |
|---|---|---|
Exit code 2 and a message that names a flag | A choice is open and there is no terminal to ask in | Set the flag the message names, for example --apps. See The CLI asks for a flag. |
Exit code 5 | A build of this project is already running | Wait for it, or follow it with lly project status --watch. See The project is busy. |
Exit code 6 | The scan took longer than 20 minutes or the build longer than 45 minutes | Run the command again. See The deploy takes too long. |
Exit code 7 | Fetch, build or rollout failed, or GitHub is not connected | Run lly attach --build <slug> to read the build log. See The build failed. |
A reason that starts with fetch: | The download failed, for example because the branch does not exist | Check the branch name and your GitHub connection. See GitHub is not connected. |
More messages and their fixes: Troubleshooting.
Use an agent
Deploy this repository to LILY with the lly CLI.
Check that the branch is pushed, then run `lly deploy -y --json` from the repository root.
If it exits with code 2, set the flag its hint names and run it again.
If it exits with code 7, show me the build log with `lly attach <slug> --build`.
When it is live, tell me the URL and the app slug. Do not commit, push or delete anything without asking me.