{"id":274,"date":"2025-08-13T14:12:08","date_gmt":"2025-08-13T14:12:08","guid":{"rendered":"https:\/\/myallcodes.in\/?p=274"},"modified":"2025-08-27T09:21:59","modified_gmt":"2025-08-27T09:21:59","slug":"node-js-demo-app-with-ci-cd-using-github-actions-dockerhub","status":"publish","type":"post","link":"https:\/\/myallcodes.in\/index.php\/2025\/08\/13\/node-js-demo-app-with-ci-cd-using-github-actions-dockerhub\/","title":{"rendered":"Node.js Demo App with CI\/CD using GitHub Actions &amp; DockerHub"},"content":{"rendered":"\n<p>This is a simple Node.js application that demonstrates how to set up a&nbsp;<strong>CI\/CD pipeline<\/strong>&nbsp;using&nbsp;<strong>GitHub Actions<\/strong>&nbsp;and&nbsp;<strong>DockerHub<\/strong>. The pipeline automatically builds, tests, and deploys the Docker image to DockerHub whenever changes are pushed to the&nbsp;<code>main<\/code>&nbsp;branch.<\/p>\n\n\n\n<p>\ud83d\udd17 GitHub Repository \ud83d\udc49 GitHub: jaspreet237\/nodejs-demo-app<br>\ud83d\udc49 Youtube Link : https:\/\/youtube.com\/shorts\/Ys0DX15pdaA?feature=share<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee0 Tech Stack<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-tech-stack\"><\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Node.js (HTTP server)<\/li>\n\n\n\n<li>Docker<\/li>\n\n\n\n<li>GitHub Actions (CI\/CD)<\/li>\n\n\n\n<li>DockerHub (Image registry)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcc1 Project Structure<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-project-structure\"><\/a><\/h2>\n\n\n\n<p>nodejs-demo-app\/<\/p>\n\n\n\n<p>\u251c\u2500\u2500 .github\/<\/p>\n\n\n\n<p>\u2502 \u2514\u2500\u2500 workflows\/<\/p>\n\n\n\n<p>\u2502 \u2514\u2500\u2500 main.yml # GitHub Actions pipeline<\/p>\n\n\n\n<p>\u251c\u2500\u2500 Dockerfile # Docker build instructions<\/p>\n\n\n\n<p>\u251c\u2500\u2500 .dockerignore # Docker ignore rules<\/p>\n\n\n\n<p>\u251c\u2500\u2500 app.js # Main Node.js app<\/p>\n\n\n\n<p>\u251c\u2500\u2500 package.json # Project metadata &amp; scripts<\/p>\n\n\n\n<p>\u2514\u2500\u2500 README.md # You&#8217;re here!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udea6 CI\/CD Pipeline Overview<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-cicd-pipeline-overview\"><\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccc Trigger<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-trigger\"><\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Runs on every&nbsp;<strong>push to the&nbsp;<code>main<\/code>&nbsp;branch<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 Pipeline Steps<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-pipeline-steps\"><\/a><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Checkout code from GitHub<\/li>\n\n\n\n<li>Set up Node.js environment<\/li>\n\n\n\n<li>Run&nbsp;<code>npm install<\/code>&nbsp;and&nbsp;<code>npm test<\/code><\/li>\n\n\n\n<li>Log in to DockerHub<\/li>\n\n\n\n<li>Build Docker image<\/li>\n\n\n\n<li>Push image to DockerHub repository<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd10 GitHub Secrets Required<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-github-secrets-required\"><\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>DOCKERHUB_USERNAME<\/code>: Your DockerHub username<\/li>\n\n\n\n<li><code>DOCKERHUB_TOKEN<\/code>: Your DockerHub&nbsp;<strong>access token<\/strong>&nbsp;(not your password)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\uddea Run the App Locally<a href=\"https:\/\/github.com\/jaspreet237\/nodejs-demo-app#-run-the-app-locally\"><\/a><\/h2>\n\n\n\n<p>Make sure Docker is installed and running on your system.<\/p>\n\n\n\n<p>\ud83d\udd3d Pull from DockerHub docker pull \/nodejs-demo-app<\/p>\n\n\n\n<p>\u25b6\ufe0f&nbsp;Run the container docker run -d -p 3000:3000 \/nodejs-demo-app Visit:&nbsp;<a href=\"http:\/\/localhost:3000\/\">http:\/\/localhost:3000<\/a>&nbsp;You\u2019ll see: Hello from Node.js App via GitHub Actions CI\/CD<\/p>\n\n\n\n<p>\ud83d\udce6 Docker Image Link \ud83d\udc49 DockerHub: jaspreet237\/nodejs-demo-app<\/p>\n\n\n\n<p>\ud83d\udcda What I Learned Created a simple Node.js app with HTTP server<\/p>\n\n\n\n<p>Dockerized the application<\/p>\n\n\n\n<p>Set up a full CI\/CD pipeline with GitHub Actions<\/p>\n\n\n\n<p>Automated Docker builds and deployment to DockerHub<\/p>\n\n\n\n<p>\ud83d\udd17 GitHub Repository \ud83d\udc49 GitHub: jaspreet237\/nodejs-demo-app<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a simple Node.js application that demonstrates how to set up a&nbsp;CI\/CD pipeline&nbsp;using&nbsp;GitHub Actions&nbsp;and&nbsp;DockerHub. The pipeline automatically builds, tests, and deploys the Docker image to DockerHub whenever changes are pushed to the&nbsp;main&nbsp;branch. \ud83d\udd17 GitHub Repository \ud83d\udc49 GitHub: jaspreet237\/nodejs-demo-app\ud83d\udc49 Youtube Link : https:\/\/youtube.com\/shorts\/Ys0DX15pdaA?feature=share \ud83d\udee0 Tech Stack \ud83d\udcc1 Project Structure nodejs-demo-app\/ \u251c\u2500\u2500 .github\/ \u2502 \u2514\u2500\u2500 workflows\/\u2026 <span class=\"read-more\"><a href=\"https:\/\/myallcodes.in\/index.php\/2025\/08\/13\/node-js-demo-app-with-ci-cd-using-github-actions-dockerhub\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","category-power-shell-scripts"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/comments?post=274"}],"version-history":[{"count":2,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/posts\/274\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/categories?post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myallcodes.in\/index.php\/wp-json\/wp\/v2\/tags?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}