Skip to main content
Back to Blog
TutorialDecember 15, 20245 min read

Setting Up GitHub Auto-Deploy for Your Discord Bot

Learn how to set up automatic deployments from GitHub to NexusHost. Push code, bot updates automatically.

Alex Rivera

Alex Rivera

DevOps Engineer

Setting Up GitHub Auto-Deploy for Your Discord Bot

Setting Up GitHub Auto-Deploy for Your Discord Bot

One of NexusHost's best features is automatic deployment from GitHub. Here's how to set it up.

Why Auto-Deploy?

Manual deployments are error-prone and time-consuming:

  • Upload files manually
  • Remember to restart the bot
  • Risk of deploying wrong version

With auto-deploy:

  • Push to GitHub
  • Bot updates automatically
  • Zero downtime deployments

Setup Steps

1. Connect GitHub

In your NexusHost dashboard:

  1. Go to Settings > GitHub
  2. Click "Connect GitHub"
  3. Authorize NexusHost

2. Select Repository

Choose your bot's repository from the list.

3. Configure Branch

Select which branch triggers deployments (usually main or production).

4. Set Start Command

NexusHost auto-detects most setups, but you can customize:

  • Node.js: node index.js
  • Python: python main.py

Environment Variables

Never commit tokens to GitHub! Use NexusHost's environment variables:

  1. Go to Settings > Environment
  2. Add DISCORD_TOKEN
  3. Add any other secrets

Deployment Flow

git add .
git commit -m "Add new command"
git push origin main

# NexusHost automatically:
# 1. Pulls the new code
# 2. Installs dependencies
# 3. Restarts your bot

Rollback

Made a mistake? Roll back instantly:

  1. Go to Deployments
  2. Find the previous version
  3. Click "Redeploy"

Conclusion

Auto-deploy transforms your development workflow. Code locally, push to GitHub, and your bot updates automatically.

Related Articles