{"id":3214,"date":"2026-08-13T00:01:21","date_gmt":"2026-08-12T17:01:21","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/08\/13\/how-to-set-up-a-ci-cd-pipeline-with-github-actions\/"},"modified":"2026-08-13T00:01:22","modified_gmt":"2026-08-12T17:01:22","slug":"how-to-set-up-a-ci-cd-pipeline-with-github-actions","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/08\/13\/how-to-set-up-a-ci-cd-pipeline-with-github-actions\/","title":{"rendered":"How to Set Up a CI\/CD Pipeline with GitHub Actions"},"content":{"rendered":"<h1>How to Set Up a CI\/CD Pipeline with GitHub Actions<\/h1>\n<p>GitHub Actions is a powerful automation engine built into GitHub. It allows you to build, test, and deploy your applications directly from your repository without maintaining separate CI servers.<\/p>\n<p>In this tutorial, you&#8217;ll create a robust pipeline that runs automated tests on every commit and deploys to a server after successful verification. Basic YAML knowledge is helpful.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sumberlaba.com\/wp-content\/uploads\/2026\/08\/article-1786554077098.jpg\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>1. Create the Workflow File<\/h2>\n<p>In your repository, create a folder named <strong>.github\/workflows<\/strong>. Add a YAML file, for example <strong>ci-cd.yml<\/strong>, to define the pipeline configuration.<\/p>\n<h2>2. Define Triggers and Build Job<\/h2>\n<ul>\n<li>Use the <strong>on<\/strong> directive to trigger the pipeline on <strong>push<\/strong> or <strong>pull_request<\/strong> events.<\/li>\n<li>Set <strong>runs-on: ubuntu-latest<\/strong> as the virtual environment.<\/li>\n<li>Add steps to checkout code, install dependencies, and run tests like <strong>npm test<\/strong>.<\/li>\n<\/ul>\n<h2>3. Add a Deployment Job<\/h2>\n<p>Create a second job that depends on the test job using <strong>needs<\/strong>. Use GitHub Secrets to store your server IP, username, and SSH key. Then deploy using a community action or a simple SSH command.<\/p>\n<h2>4. Apply Best Practices<\/h2>\n<ul>\n<li>Cache dependencies to speed up builds.<\/li>\n<li>Pin actions to specific commit SHAs for supply-chain security.<\/li>\n<li>Require manual approval for production deployment via environment protection rules.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>You now have a fully automated CI\/CD pipeline. Every push triggers tests, and a successful run automatically deploys your application, giving you faster, more reliable releases.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Set Up a CI\/CD Pipeline with GitHub Actions GitHub Actions is a powerful automation engine built into GitHub. It allows you to build, test, and deploy your applications directly from your repository without maintaining separate CI servers. In this tutorial, you&#8217;ll create a robust pipeline that runs automated tests on every commit and &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":3213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3214","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-category"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=3214"}],"version-history":[{"count":1,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3214\/revisions"}],"predecessor-version":[{"id":3215,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3214\/revisions\/3215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media\/3213"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=3214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=3214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=3214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}