This repository contains a GitHub Actions workflow that automatically builds and pushes n8n Docker images to GitHub Container Registry (GHCR).
The workflow (build-and-push.yml) performs the following steps:
- Clone n8n Repository: Clones the official n8n repository from
https://github.com/n8n-io/n8n - Setup Environment: Installs Node.js 18 and pnpm package manager
- Install Dependencies: Runs
pnpm install --frozen-lockfile - Build Project: Executes
pnpm run build - Build Docker Image: Runs
pnpm run build:docker - Push to GHCR: Tags and pushes the image to
ghcr.io/mroplus/n8n:enterprise
The workflow runs on:
- Push to
masterbranch - Pull requests to
masterbranch - Manual trigger via GitHub Actions UI (
workflow_dispatch)
The workflow creates multiple tags for the Docker image:
ghcr.io/mroplus/n8n:enterprise- Main enterprise tagghcr.io/mroplus/n8n:latest- Latest build (only on master branch)ghcr.io/mroplus/n8n:<commit-sha>- Specific commit version from this repositoryghcr.io/mroplus/n8n:n8n-<n8n-commit-hash>- Specific n8n source repository commit version
The workflow requires the following permissions (already configured):
contents: read- To checkout the repositorypackages: write- To push Docker images to GHCR
The workflow uses the GITHUB_TOKEN automatically provided by GitHub Actions. No additional secrets need to be configured for GHCR access.
- Push changes to the
masterbranch or create a pull request - The workflow will automatically trigger and build the n8n Docker image
- On successful completion, the image will be available at
ghcr.io/mroplus/n8n:enterprise
To use the built Docker image:
docker pull ghcr.io/mroplus/n8n:enterprise
docker run -d --name n8n -p 5678:5678 ghcr.io/mroplus/n8n:enterprise- Check the Actions tab in your GitHub repository for build logs
- Ensure your repository has Actions enabled
- Verify that the GitHub Container Registry is accessible from your account
- Make sure the repository visibility allows package publishing
The workflow includes cleanup steps to prevent disk space issues and provides detailed logging for each build step.