{"id":1920,"date":"2026-07-22T00:02:35","date_gmt":"2026-07-21T17:02:35","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/22\/how-to-set-up-a-ci-cd-pipeline-with-github-actions-a-step-by-step-guide\/"},"modified":"2026-07-22T00:02:35","modified_gmt":"2026-07-21T17:02:35","slug":"how-to-set-up-a-ci-cd-pipeline-with-github-actions-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/22\/how-to-set-up-a-ci-cd-pipeline-with-github-actions-a-step-by-step-guide\/","title":{"rendered":"How to Set Up a CI\/CD Pipeline with GitHub Actions: A Step-by-Step Guide"},"content":{"rendered":"<h1>How to Set Up a CI\/CD Pipeline with GitHub Actions: A Step-by-Step Guide<\/h1>\n<p>GitHub Actions automates software workflows directly in your repository. With CI\/CD, you can build, test, and deploy your code automatically every time you push changes. This eliminates manual errors and speeds up delivery. All you need is a GitHub repository and a YAML workflow file.<\/p>\n<p>A workflow is a configurable automated process defined in <code>.github\/workflows\/<\/code>. It runs when a specific event occurs, like a push or pull request. You can run multiple jobs in parallel or sequence, each with its own set of steps. The rest of this tutorial shows you how to create a basic CI\/CD pipeline.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/via.placeholder.com\/800x600\/4a90d9\/ffffff?text=how%20to%20set%20up%20a%20CI%2FCD%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 repository, create a new directory <code>.github\/workflows\/<\/code>. Inside, add a <code>.yml<\/code> file, for example <code>ci.yml<\/code>. Name it whatever fits your project. Every workflow starts with:<\/p>\n<ul>\n<li><code>name:<\/code> \u2013 A descriptive name for the workflow.<\/li>\n<li><code>on:<\/code> \u2013 The event that triggers the workflow, e.g., <code>push<\/code>, <code>pull_request<\/code>.<\/li>\n<\/ul>\n<h2>2. Define the Trigger<\/h2>\n<p>Specify when the pipeline runs. For a typical CI\/CD pipeline, trigger on pushes to the main branch and pull requests:<\/p>\n<pre><code>on:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n<\/code><\/pre>\n<p>You can also schedule runs with <code>schedule<\/code> or trigger manually via <code>workflow_dispatch<\/code>.<\/p>\n<h2>3. Add Jobs and Steps<\/h2>\n<p>Under <code>jobs:<\/code>, define a job (e.g., <code>build<\/code>). Each job runs on a runner \u2013 use <code>ubuntu-latest<\/code> for Linux. Steps can check out code, set up dependencies, run tests, and deploy. Example:<\/p>\n<pre><code>jobs:\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>4. Deploy Using Secrets<\/h2>\n<p>For deployment, store sensitive data (API keys, SSH keys) in GitHub Secrets (Settings \u2192 Secrets and variables). Reference them as <code>${{ secrets.MY_SECRET }}<\/code>. Add a deployment step using a ready-made action or a custom script.<\/p>\n<pre><code>      - name: Deploy to production\n        env:\n          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}\n        run: .\/deploy.sh\n<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>GitHub Actions makes CI\/CD simple. Start with a basic workflow, test it, then expand with parallel jobs, caching, or custom actions. Your code will move from commit to production automatically, reducing manual work and increasing reliability.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Set Up a CI\/CD Pipeline with GitHub Actions: A Step-by-Step Guide GitHub Actions automates software workflows directly in your repository. With CI\/CD, you can build, test, and deploy your code automatically every time you push changes. This eliminates manual errors and speeds up delivery. All you need is a GitHub repository and a &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-1920","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1920","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=1920"}],"version-history":[{"count":0,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1920\/revisions"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}