DEV Community

Sospeter Mong'are
Sospeter Mong'are

Posted on

6 Things I Wish I Knew Before My First CI/CD Deployment

I Just Deployed My First App with GitHub Actions!

Here are 6 things I wish I knew earlier 🧵

Setting up CI/CD for the first time can feel like a maze — especially when you’re excited to automate but aren’t sure what bumps are waiting along the way. After deploying my Laravel API app using GitHub Actions, here are 6 key lessons that apply to any tech stack.


1. 🔑 CI/CD Isn’t Just About Automation — It’s About Resilience

The goal of CI/CD isn’t just “automatic deployments.” It’s about building confidence in your deployments and being ready when things go wrong. Set up your pipeline to be predictable, repeatable, and easy to debug — because someday, it will break.

✅ Automate to recover, not just to deploy.


2. ⚠️ Don't Cache Config Before .env Is Ready

If your pipeline runs php artisan config:cache (or similar in other frameworks), make sure .env is already in place. Caching config too early can cause frustrating bugs like broken DB connections or missing credentials.

🔐 Bonus: Use environment-specific flags like --env=production when caching config in production-only environments.


3. 📦 Know What Your Deployment Method Supports

I used FTP initially and hit a wall: my server only supported SFTP. Lesson learned: check whether your host supports FTP, FTPS, or SFTP before choosing your GitHub Action.

🔧 If using SamKirkland/FTP-Deploy-Action, your server must support FTP or FTPS — not SFTP.


4. 🌍 Understand Your Server Structure

My files were uploading to the root instead of my subdomain directory. You need to know:

  • The full absolute path to your deployment directory
  • Whether your host sets the FTP/SFTP home directory automatically
  • Where your .env, public, or index files are expected

🧭 Always verify the server directory before syncing files.


5. 🔎 Always Test Credentials Before Automating

I wasted time debugging GitHub Actions when the real issue was wrong FTP credentials. Tools like FileZilla help confirm your credentials and home directory paths manually before automating.

✅ Tip: Test login manually, note the working path, and match it in your pipeline.


6. 🧪 Start Small, Then Expand

Don’t aim to automate everything on day one. Start by:

  • Installing dependencies
  • Running tests
  • Deploying code

Once stable, you can add:

  • Database migrations
  • Asset compilation
  • Notifications (Slack, Email, etc.)

🧠 Simplicity first. Stability next. Then scale.


🎯 Final Thoughts

CI/CD is a game-changer — not just for speed, but for peace of mind. And while it’s tempting to copy a full pipeline from Stack Overflow or ChatGPT (😉), understanding each step is what makes you truly ready for production.

Let your pipelines work for you, not the other way around.

Top comments (1)

Collapse
 
vincenttommi profile image
Vincent Tommi

solid