{"id":1405,"date":"2026-07-10T18:15:40","date_gmt":"2026-07-10T11:15:40","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/10\/how-to-set-up-a-ci-pipeline-with-github-actions-a-step-by-step-guide\/"},"modified":"2026-07-10T18:15:40","modified_gmt":"2026-07-10T11:15:40","slug":"how-to-set-up-a-ci-pipeline-with-github-actions-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/10\/how-to-set-up-a-ci-pipeline-with-github-actions-a-step-by-step-guide\/","title":{"rendered":"How to Set Up a CI Pipeline with GitHub Actions: A Step-by-Step Guide"},"content":{"rendered":"<h1>How to Set Up a CI Pipeline with GitHub Actions: A Step-by-Step Guide<\/h1>\n<p>Continuous Integration (CI) automates building and testing your code every time you push. GitHub Actions makes this easy with YAML-based workflows that run directly in your repository. In this guide, you\u2019ll learn the essentials to create a basic CI pipeline that checks code quality and runs tests.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/via.placeholder.com\/800x600\/4a90d9\/ffffff?text=how%20to%20set%20up%20a%20CI%20pipeline%20with%20GitHub%20Actions\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>1. Create Your First Workflow File<\/h2>\n<p>In your repo, create a folder <code>.github\/workflows\/<\/code> and add a file named <code>ci.yml<\/code>. This YAML file defines when and how the pipeline runs.<\/p>\n<h3>Define the Trigger and Job<\/h3>\n<ul>\n<li><strong>Trigger:<\/strong> Set <code>on: [push, pull_request]<\/code> to run on every push or PR.<\/li>\n<li><strong>Job:<\/strong> Use <code>jobs:<\/code> to define a job like <code>build:<\/code> that runs on <code>ubuntu-latest<\/code>.<\/li>\n<\/ul>\n<pre><code>name: CI\non: [push, pull_request]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\/checkout@v3\n      - name: Install dependencies\n        run: npm ci\n      - name: Run tests\n        run: npm test\n<\/code><\/pre>\n<h2>2. Add Steps for Dependencies and Testing<\/h2>\n<p>Each step runs sequentially. For a Node.js project, you\u2019ll check out code, install packages (<code>npm ci<\/code> for clean installs), and then execute tests. Adjust commands for your language (e.g., <code>pip install<\/code> for Python, <code>mvn test<\/code> for Java).<\/p>\n<h2>3. Use Pre-Built Actions and Secrets<\/h2>\n<p>GitHub Marketplace offers actions like <code>actions\/setup-node<\/code> to configure runtimes. To protect sensitive data, use <strong>Secrets<\/strong> (Settings > Secrets > Actions) and reference them as <code>${{ secrets.MY_SECRET }}<\/code> in your workflow.<\/p>\n<h2>4. Customize with Matrix Builds and Caching<\/h2>\n<p>Speed up your pipeline:<\/p>\n<ul>\n<li><strong>Matrix builds:<\/strong> Run tests across multiple OS\/versions using <code>strategy.matrix<\/code>.<\/li>\n<li><strong>Caching:<\/strong> Use <code>actions\/cache<\/code> to store <code>node_modules<\/code> and avoid re-downloading dependencies.<\/li>\n<\/ul>\n<h3>Example Matrix Snippet<\/h3>\n<pre><code>strategy:\n  matrix:\n    node-version: [14, 16, 18]\nsteps:\n  - uses: actions\/setup-node@v3\n    with:\n      node-version: ${{ matrix.node-version }}\n<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>You\u2019ve now built a functional CI pipeline on GitHub Actions. Start with the basic workflow, then expand with caching, matrix builds, and custom actions. Every push will automatically validate your code, giving you faster feedback and a more robust development cycle.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Set Up a CI Pipeline with GitHub Actions: A Step-by-Step Guide Continuous Integration (CI) automates building and testing your code every time you push. GitHub Actions makes this easy with YAML-based workflows that run directly in your repository. In this guide, you\u2019ll learn the essentials to create a basic CI pipeline that checks &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-1405","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1405","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=1405"}],"version-history":[{"count":0,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1405\/revisions"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}