Deploy an app from GitHub
Build a container from a GitHub repository and redeploy it on every push.
Goal: an app that A-Line.cloud builds from your repository and deploys again whenever you push to a branch.
Before you start
- A project on a running cluster.
- A repository with a
Dockerfile, or a Node.js project with apackage.json(A-Line.cloud detects a build preset for it). - For private repositories and automatic deploys: GitHub connected under Settings > Integrations > Connect GitHub. A public repository works without it, but only deploys when you start it by hand.
Steps
On the project canvas, select From Git in the sidebar. The Deploy from Git dialog opens.
Repository. Under Repository source, pick Connected repos (through the GitHub App) or Public repository (paste any public URL). Choose the repository and the Branch. Leave Deploy as on Container. If the repository looks like a static site, the dialog marks Static site as Detected; see Deploy a static site for that path. Select Next.
Build. Check the Build Preset (detected from package.json),
or set the Dockerfile Path and Build Context. Add Build
Arguments if your Dockerfile needs them. Select Next.
Trigger (connected repos only). Under Automatic Deploy Trigger,
pick On push to branch and enter a branch pattern such as main or
release/*. You can deploy on tags instead: On pre-release or On
full release with a tag pattern such as v*. Select Next.
Settings. Enter the app's Name, the Port your app listens on, the number of Replicas and any Environment Variables.
Select Create & Deploy.
Verify
Open the app and go to the Deploys tab. The first deploy shows its build
log, then moves through building and deploying to succeeded. Push a
commit to the branch: a new deploy starts on its own.
To reach the app from a browser, add a domain.
Troubleshooting
- No GitHub connection: connect GitHub under Settings > Integrations, or switch to Public repository.
- The build fails: open the deploy on the Deploys tab and read the build log. Most failures are a wrong Dockerfile Path or Build Context, or a missing Build Argument.
- A push did not start a build: check the branch pattern of the trigger.
If the build history shows a
refusedentry, your balance is out of credit or the monthly spend cap is reached; see refused builds. - The deploy never becomes ready: check that Port is the port the process listens on, and read the Logs tab.
Next steps
- Add a custom domain
- Add a database and connect the app
- Store secrets
- Builds and deploys: how builds, rollouts and rollbacks work.
- Apps in IaC: the same app as a file in Git.