Prerequisites
- A project in Orchard
- A GitHub repository with a Dockerfile
- GitHub access configured (for private repositories)
Creating a Deployment
1
Navigate to your project
Open the project where you want to create the deployment.
2
Click 'New Deployment'
Click the New Deployment button.
3
Select 'From GitHub'
Choose the From GitHub deployment method.
4
Configure the deployment
Fill in the required fields:
| Field | Description | Example |
|---|---|---|
| Name | Unique name for this deployment | api-server |
| Repository URL | Full GitHub repository URL | https://github.com/org/repo |
| Branch | Branch to build from | main |
| Dockerfile Path | Path to your Dockerfile | ./Dockerfile |
| Port | Port your application listens on | 3000 |
5
Configure build options
- Build Type: Choose
dockerfile(default) orrailpack - Build From Root: Enable if your Dockerfile needs access to the entire repo
6
Add environment variables (optional)
Add any environment variables your application needs.
7
Create
Click Create Deployment to start the build process.
Build Process
When you create a GitHub deployment, Orchard runs through these steps:Build Types
Dockerfile (Default)
The standard build type. Orchard runsdocker build using your Dockerfile:
Railpack
Railpack is an alternative builder optimized for Ruby on Rails applications. It automatically:- Detects Rails configuration
- Installs dependencies
- Compiles assets
- Sets up the runtime environment
Railpack is specifically designed for Rails apps. For other frameworks, use the standard Dockerfile build type.
Dockerfile Path
TheDockerfile Path tells Orchard where to find your Dockerfile:
| Path | Location |
|---|---|
./Dockerfile | Repository root |
./docker/Dockerfile | docker subdirectory |
./services/api/Dockerfile | Nested path for monorepos |
Build Context
The Build From Root option controls the Docker build context:- Disabled (Default)
- Enabled
The build context is the directory containing the Dockerfile.Your Dockerfile can only
COPY files from the docker/ directory.Pros: Faster builds, smaller context
Cons: Limited file accessPrivate Repositories
For private GitHub repositories, you need to configure GitHub access:1
Go to user settings
Click on your profile and select Settings.
2
Connect GitHub
In the GitHub section, authorize Orchard to access your repositories.
3
Use the repository
Now you can deploy from any repository you have access to.
Rebuilding
To rebuild your deployment with the latest code:1
Open your deployment
Navigate to the deployment you want to rebuild.
2
Click 'Rebuild'
Click the Rebuild button.
3
Wait for completion
Orchard will clone the latest code, build a new image, and deploy it.
Rebuilding uses the same branch and Dockerfile path as the original deployment. To change these, update the deployment settings.
Canceling a Build
If you need to stop an in-progress build:- Go to your deployment
- Click Cancel Build
- The build will be terminated and no changes will be made
Image History
Every successful build creates a new image that’s stored in your deployment’s history. You can:- View all past builds with timestamps
- See which Git commit each build corresponds to
- Rollback to any previous build
Rollbacks
To rollback to a previous version:1
Open History tab
Navigate to your deployment’s History tab.
2
Find the version
Locate the image version you want to restore.
3
Rollback
Click Rollback next to that version.
4
Confirm
Confirm the rollback. Your deployment will update to use the older image.
Example: Node.js Application
Here’s a complete example for deploying a Node.js app: Repository structure:- Name:
my-api - Repository:
https://github.com/myorg/my-api - Branch:
main - Dockerfile Path:
./Dockerfile - Port:
3000
Troubleshooting
Clone failed
Clone failed
If the repository fails to clone:
- Verify the repository URL is correct
- Check that the branch exists
- For private repos, ensure GitHub access is configured
Build failed
Build failed
If the Docker build fails:
- Check the build logs for error messages
- Verify your Dockerfile is valid
- Ensure all required files are in the build context
- Try enabling “Build From Root” if files are missing
Push failed
Push failed
If the image fails to push:
- Check the build logs for registry errors
- This is usually a temporary issue - try rebuilding