Slide 1
-----------
Part 1: In the previous lecture, we discussed Continuous Integration, which ensures that your app is healthy and ready to ship! In this lecture, we'll explore automated methods for deploying your application for preview to testers or to production.
Slide 2
-----------
Part 1: You’ve built a blogging app, but manual deploys slow you down. Continuous Deployment (CD) automates pushing code live—fast and error-free. Today, we’ll make our app shine!
Part 2: CD saves time, cuts mistakes, and lets you focus on coding—like adding filters to our blog. It’s essential for modern dev workflows.
Part 3: Think the CD breaks everything as you lose control? Nope—it’s safe with tests. Let’s see how.
Slide 3
-----------
Part 1: In your app, when you create a new feature branch and push it to the repository, CD tools deploy it as a preview—like a sandbox to test live without risking the main site.
Part 2: The CD tool creates and publishes a new URL for automatically previewing your feature changes. CD tools use wildcard DNS to map branches to URLs instantly—no manual setup required.
Part 3: When you fix bugs in the preview and merge these changes to main, CD deploys it live. Simple and safe!
Slide 4
-----------
Part 1: For React apps, Vercel does a wonderful job. When you register, all you need to do is create a new project, link your GitHub repository and push it to GitHub. From now on it auto-detects your build—done!
Slide 5
-----------
Part 1: Vercel automatically detects where the change happened.
Part 2: In this case,the changes come from the trpc branch ...
Part 3: ... so Vercel creates a new Preview deployment ...
Part 4: ... automatically creating temporary URLs where you can check your preview deployment.
Slide 6
-----------
Part 1: For production you must do things differently.
Part 2: You must publish your code to the main branch.
Part 3: Which automatically creates production deployment.
Part 4: It assigns the main application URL, along with new testing URLs for future use, when you change your production code again.
Slide 7
-----------
Part 1: Let's talk about advantages, disadvantages and alternatives to Vercel deployments.
Part 2: The advantage of using trusted CD providers such as Vercel is their speed. The auto-DNS makes our blog’s filter feature live in minutes. Free tier’s a bonus!
Part 3: The disadvantage is that you get less control over servers, meaning our admin backend might need more. Costs rise with traffic, too.
Part 4: There are also many alternatives to Vercel, each different in features and pricing.
Part 5: Netlify is like Vercel, great for our blog’s frontend. It's free and easy, but less for backends.
Part 6: Heroku supports Node.js needs. It scales well but has slower deploys.
Part 7: You can also host your own server or use cloud servers such as AWS, Azure or Digital Ocean in combination with CI pipelines such as Github actions. There is much more to set up, but you gain absolute control ... largely over the cost as well.
Slide 8
-----------
Part 1: Let's wrap up!
Part 2: The key takeway is to understand that CD streamlines your app updates. From previews to production it controls what your developers and users use to make decisions about your product.
Part 3: With CI/CD always run tests—automation needs guardrails for our app to thrive.
Part 4: When setting up CI/CD it is easy to lose yourself in countless hours of configuring your pipelines. Do not overcomplicate things. Start siimple and free. with Vercel and Github Actions, scale to custom.
CONTINUOUS DEPLOYMENT MADE SIMPLE
Imagine you’re building a blogging app where users can read posts, filter them
by tags or dates, and admins can add or edit posts. You’ve just finished a new
feature—say, a tag-filtering system—and you’re excited to share it with the
world. But deploying it manually means uploading files, running tests, and
praying nothing breaks. What if your changes could go live instantly, safely,
and without the hassle? That’s where Continuous Deployment (CD) comes in.
CD automates releasing your code to production every time you push a change, as
long as it passes tests. It saves time, cuts errors, and lets you focus on
building—like perfecting that blogging app. Today, we’ll use this app as our
example to explore CD, from preview deployments to custom pipelines.
Here’s a question: How many of you think deploying is just “pushing code live”?
It’s more than that—and doing it wrong can crash your app or frustrate users!
SECTION 1: BUSTING MYTHS AND SETTING UP CD WITH GITHUB BRANCHES
COMMON MISCONCEPTIONS
Think, “Deploying every change instantly will break everything”? Nope! CD uses
automation and tests to stay safe. Or, “CD is only for big teams”? Wrong—it’s
for anyone who wants efficiency, even solo devs.
HOW IT WORKS WITH GITHUB BRANCHES
For our blogging app, say you’re adding a “filter by date” feature on a branch
called feature/date-filter. With CD, you get preview deployments—temporary
versions of your app for that branch. Test it live without risking the main
site.
The flow:
1. Push to feature/date-filter.
2. A CD tool detects the change.
3. It builds and deploys a preview—e.g., date-filter.feature.myblogapp.com.
4. Test it, fix bugs, then merge to main for production.
HANDLING DNS FOR PREVIEWS
How does date-filter.feature.myblogapp.com just work? Tools like Vercel (more on
this soon) manage DNS automatically. They assign subdomains to each branch using
a wildcard DNS record (e.g., *.myblogapp.com). When you push, their system maps
the branch name to a unique URL, no manual DNS tweaks needed. It’s like
magic—but it’s just smart automation.
SECTION 2: CONTINUOUS DEPLOYMENT WITH VERCEL
WHAT’S VERCEL [vercel.com]?
Vercel is a platform that simplifies CD, perfect for web apps like our blogging
app. It hooks into GitHub, builds your code, and deploys it effortlessly. It
includes advanced monitoring and logging tools, firewall, DDoS protection and
much more.
[https://skillpies.s3.ap-southeast-2.amazonaws.com/courses/full-stack-development-comp3036-2025/sections/continuous-deployment-cd-in-ci-cd-and-devops/Screenshot%202025-04-08%20at%2011.58.21.png]Vercel
Dashboard for SkillPies
SETTING IT UP
For our TypeScript React app:
1. Push to a GitHub repo.
2. Link it to Vercel’s dashboard.
3. Vercel detects your setup (e.g., package.json with a build script).
4. Push to a branch? Get a preview URL. Push to main? It’s live.
EXPANDING THE EXAMPLE
Add an admin “edit posts” feature on feature/admin-edit. Vercel deploys a
preview at admin-edit.myblogapp.vercel.app. Test it, confirm it works, merge
it—live on myblogapp.com instantly.
DNS IN ACTION
Vercel’s wildcard DNS handles previews. You set a domain (e.g., myblogapp.com)
in Vercel, and it creates subdomains like
feature-admin-edit.myblogapp.vercel.app (or a custom domain if configured). No
DNS fiddling—just push and test.
PROS AND CONS
* Advantages: Quick setup, free tier, auto-scaling, DNS magic.
* Disadvantages: Less server control, ecosystem lock-in, costs scale with
usage.
SECTION 3: ALTERNATIVES TO VERCEL
OTHER OPTIONS
* Netlify: Like Vercel, great for static sites. Pros: free tier, custom
functions. Cons: weaker for complex backends.
* Heroku: Good for dynamic apps. Pros: multi-language support, scaling. Cons:
slower deploys, costly.
* GitHub Actions: Custom control (see next). Pros: flexible, free for public
repos. Cons: setup effort.
COMPARING WITH OUR APP
Vercel or Netlify for the blog frontend; Heroku or GitHub Actions for a beefy
admin backend. Match the tool to your needs.
SECTION 4: BUILDING A CUSTOM CD PIPELINE WITH GITHUB ACTIONS AND SSH
WHY CUSTOM?
For full control—like deploying to your own server—use GitHub Actions. Let’s
deploy our blogging app to myblogserver.com by pulling code via Git.
STEP-BY-STEP EXAMPLE
1. Push to <strong>main</strong>: Finish “filter by tag” and merge.
2. GitHub Action Triggers: A workflow runs.
3. SSH + Git Pull: It connects to the server, pulls the latest code, and builds
it there.
Sample workflow (.github/workflows/deploy.yml):
name: Deploy Blog App
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /var/www/blogapp
git pull origin main
pnpm install
pnpm run build
pm2 restart blogapp
* How It Works: The server has a Git repo clone. The action SSHs in, pulls from
main, installs dependencies, builds, and restarts the app (e.g., a Node.js
process).
* Expanding It: Add npm test on the server before building, or use a staging
branch for previews (though DNS would need manual setup or a tool like
Nginx).
PROS AND CONS
* Advantages: Total control, leverages Git, works anywhere.
* Disadvantages: Server maintenance, no auto-DNS for previews, setup time.
CONCLUSION
KEY TAKEAWAYS
CD speeds up deployment with safety. GitHub branches and tools like Vercel give
previews (with DNS handled via wildcards). Vercel’s easy for web apps; custom
pipelines with Git pull suit complex needs. For our blogging app, Vercel could
handle user filters, while a Git-based SSH pipeline powers the admin.
BEST PRACTICES
* Test before deploying.
* Use previews to catch issues.
* Choose tools based on complexity.
PITFALLS TO AVOID
* Don’t skip tests—automation needs guardrails.
* Don’t over-engineer; start simple, then customize.
You’re now ready to deploy like pros—making that blogging app shine with every
push!
Maggie is a generative AI that can help you understand the course content better. You can ask her questions about the lecture, and she will try to answer them. You can also see the questions asked by other students and her responses.
Join the discussion to ask questions, share your thoughts, and discuss with other learners