NEXUS AI GitHub Integration: The Complete Guide to Auto-Deploying from Your Repository

Connect any GitHub repository to NEXUS AI and ship to AWS, Google Cloud, or Azure automatically on every push — no Dockerfile required. This guide covers source deployments, GitHub Actions CI/CD, and MCP-based repo deployments end to end.

By NEXUS AI • • Tutorial

NEXUS AI GitHub Integration: The Complete Guide to Auto-Deploying from Your Repository

Deploy any GitHub repo to production in under 5 minutes

NEXUS AI ships directly from your GitHub repository — no Dockerfile, no pipeline YAML, no cloud console. Point it at a repo, choose a provider, and your code is running in a container in minutes.

This guide covers every way to connect GitHub to NEXUS AI:


How source deployments work

NEXUS AI clones your repository, auto-detects the runtime (Node.js, Python, Go, Ruby, Java, PHP, Rust), builds a container image, and deploys it to your chosen cloud provider. You never write a Dockerfile.

Supported runtimes with auto-detection:

Runtime Detected via
Node.js package.json
Python requirements.txt / pyproject.toml
Go go.mod
Ruby Gemfile
Java pom.xml / build.gradle
PHP composer.json
Rust Cargo.toml

If your repo has a Dockerfile, NEXUS AI uses it. If not, it generates one automatically.


Prerequisites


Option 1 — Deploy from the CLI

Install the CLI and deploy your repo in one command:

npm install -g @nexusai/cli
nexus login

Then deploy from source:

nexus deploy source \
  --repo github.com/your-org/your-repo \
  --provider gcp_cloud_run \
  --branch main \
  --wait

The --wait flag streams build logs to your terminal until the deployment is live. Drop it to return immediately and check status separately.

Private repositories — pass a GitHub token:

nexus deploy source \
  --repo github.com/your-org/private-repo \
  --provider aws_ecs_fargate \
  --github-token ghp_xxxxxxxxxxxx \
  --wait

Option 2 — Deploy via MCP (Claude)

With the NEXUS AI MCP connector enabled in Claude, describe what you want to deploy:

"Deploy my GitHub repo github.com/your-org/your-app to Google Cloud Run"

Claude calls nexusai_deploy_source and streams the result back to you. No terminal, no config files.

Or call the tool directly:

nexusai_deploy_source(
  repoUrl:     "github.com/your-org/your-app",
  provider:    "gcp_cloud_run",
  branch:      "main",
  environment: "PRODUCTION"
)

Option 3 — GitHub Actions CI/CD

Auto-deploy every push to main with 24 lines of GitHub Actions YAML — no custom pipeline logic.

Step 1 — Get your NEXUS AI token

Go to your NEXUS AI dashboard → Settings → API Tokens → create a token. Copy it.

Step 2 — Add the secret to GitHub

In your GitHub repo: Settings → Secrets and variables → Actions → New repository secret

Step 3 — Add the workflow file

Create .github/workflows/deploy.yml in your repository:

name: Deploy to NEXUS AI

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install NEXUS AI CLI
        run: npm install -g @nexusai/cli

      - name: Deploy
        env:
          NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
        run: |
          nexus deploy redeploy your-deployment-name --wait

Replace your-deployment-name with the name of your NEXUS AI deployment. Every push to main triggers a redeploy — typically 60–90 seconds from push to live.

First deploy vs redeployments

Use nexus deploy source for the first deploy (creates the deployment). Use nexus deploy redeploy for all subsequent pushes (rebuilds and ships the existing deployment faster, with version tracking).

# First deploy — run this once manually or in a setup job
nexus deploy source \
  --repo github.com/your-org/your-app \
  --provider gcp_cloud_run \
  --name your-deployment-name

# All subsequent pushes — in the Actions workflow
nexus deploy redeploy your-deployment-name --wait

Step 4 — Set environment variables

Your app likely needs environment variables (database URL, API keys, etc.). Add them as secrets in NEXUS AI — they are encrypted with AES-256-GCM and injected at container startup.

Via CLI:

nexus secrets set DATABASE_URL "postgresql://..." --deployment your-deployment-name
nexus secrets set API_KEY "sk-..." --deployment your-deployment-name

Via MCP:

nexusai_secrets_create(
  deploymentId: "your-deployment-id",
  key:          "DATABASE_URL",
  value:        "postgresql://..."
)

Secrets are never baked into the container image. They are resolved at runtime only.


Step 5 — Monitor your deployment

After the workflow runs, check status and logs:

# Deployment status and public URL
nexus deploy status your-deployment-name

# Live logs
nexus deploy logs your-deployment-name --follow

Or ask Claude:

"Show me the logs for my your-app deployment"


Managing your GitHub-deployed app

Action CLI When to use
Redeploy nexus deploy redeploy your-app Push a new version
Rollback nexus deploy rollback your-app Revert to previous version
Scale nexus deploy scale your-app 3 Handle more traffic
Stop nexus deploy stop your-app Pause (save compute costs)
Logs nexus deploy logs your-app Debug runtime issues

Rollback restores the previous container image — no rebuild, no GitHub checkout, typically under 60 seconds.


Custom domain

Attach a custom domain so your deployment URL stays stable across redeployments:

nexus domains add your-deployment-name --domain app.yourdomain.com

Point a CNAME record at the value NEXUS AI returns, then verify:

nexus domains verify your-deployment-name --domain app.yourdomain.com

Troubleshooting

Build fails immediately

Check the runtime is correctly detected. If your repo has an unusual structure, add a Dockerfile at the root — NEXUS AI uses it automatically.

App starts but returns 502

Your application is not binding to 0.0.0.0 on the PORT environment variable. NEXUS AI injects PORT at runtime. Make sure your server listens on process.env.PORT (Node.js) or os.environ.get('PORT', 8080) (Python).

Private repo clone fails

The GitHub token must have repo scope. Generate a classic Personal Access Token (PAT) with repo checked — fine-grained tokens may not have sufficient permissions for all provider combinations.

Redeployment takes longer than expected

The first redeploy after a base image update rebuilds more layers. Subsequent redeployments use the layer cache and typically complete in 60–90 seconds.


Wrapping up

From zero to auto-deploying GitHub repo:

  1. nexus deploy source — first deploy, runtime auto-detected
  2. Add NEXUSAI_TOKEN to GitHub Secrets
  3. Add the 24-line deploy.yml workflow
  4. Every push to main ships automatically

No Dockerfile. No pipeline YAML beyond the 24-line workflow. No cloud console.


Try it now: Install the CLI with npm install -g @nexusai/cli and run nexus deploy source --repo github.com/your-org/your-app --provider gcp_cloud_run --wait


NEXUS AI — AI-native cloud infrastructure · nexusai.run