---
title: "Setup CI/CD Pipeline dengan GitHub Actions dan Helipod"
url: "https://helipod.io/blog/ci-cd-github-actions-helipod"
date: "2026-06-03"
updated: "2026-06-03"
author: "Tim Helipod"
tags: ["CI/CD", "GitHub Actions", "automation", "devops", "helipod"]
excerpt: "Automate deployment dari GitHub ke Helipod menggunakan GitHub Actions. Push ke main branch, otomatis build dan deploy."
---

# Setup CI/CD Pipeline dengan GitHub Actions dan Helipod

Manual deployment itu melelahkan. Push ke main, buka dashboard, klik deploy, tunggu selesai. Berulang-ulang.

Dengan **GitHub Actions**, kamu bisa otomatisasi seluruh proses: push code, GitHub Actions build, test, dan deploy ke Helipod, tanpa klik apapun.

## Kenapa CI/CD Penting?

| Manual Deployment | CI/CD |
|------------------|-------|
| Klik deploy manual | Otomatis setelah push |
| Lupa test sebelum deploy | Test otomatis sebelum deploy |
| Error di production | Error diangkat lebih awal |
| Deploy semua sekaligus | Deploy per commit |
| Tidak ada audit trail | Setiap deploy tercatat |

## Cara Kerja

```
Developer push ke GitHub
        ↓
GitHub Actions trigger workflow
        ↓
GitHub Actions build & test
        ↓
GitHub Actions deploy ke Helipod
        ↓
Aplikasi live
```

## Setup Step-by-Step

### Step 1: Buat Workflow File

Buat file `.github/workflows/deploy.yml` di repo kamu:

```yaml
name: Deploy to Helipod

on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Deploy to Helipod
        run: |
          echo "Deploying to Helipod..."
          # Helipod akan auto-deploy dari GitHub webhook
          # Trigger deploy via Helipod API
          curl -X POST "https://api.helipod.io/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.HELIPOD_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project": "${{ secrets.HELIPOD_PROJECT }}"}'
```

### Step 2: Generate API Key

1. Buka Helipod Dashboard → **Settings** → **API Keys**
2. Klik **Generate New Key**
3. Copy API key

### Step 3: Tambah Secrets ke GitHub

1. Buka repo di GitHub → **Settings** → **Secrets and variables** → **Actions**
2. Klik **New repository secret**
3. Tambahkan:
   - `HELIPOD_API_KEY`: API key dari Helipod
   - `HELIPOD_PROJECT`: nama project kamu

### Step 4: Push Code

```bash
git add .github/workflows/deploy.yml
git commit -m "ci: add deploy workflow"
git push origin main
```

GitHub Actions akan trigger otomatis.

## Workflow yang Lebih Lengkap

### dengan Test dan Build

```yaml
name: CI/CD Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Run tests
        run: npm test
      
      - name: Run linting
        run: npm run lint

  deploy:
    needs: test
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v4
      
      - name: Deploy to Helipod
        run: |
          curl -X POST "https://api.helipod.io/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.HELIPOD_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project": "${{ secrets.HELIPOD_PROJECT }}"}'
```

### dengan Build Status Badge

```yaml
name: CI/CD Pipeline

on:
  push:
    branches: [main]

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      
      - name: Install & Build
        run: |
          npm ci
          npm run build
      
      - name: Run Tests
        run: npm test
      
      - name: Deploy to Helipod
        if: success()
        run: |
          curl -X POST "https://api.helipod.io/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.HELIPOD_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project": "${{ secrets.HELIPOD_PROJECT }}"}'
```

Tambahkan badge ke README:

```markdown
![Deploy](https://github.com/username/repo/actions/workflows/deploy.yml/badge.svg)
```

### dengan Environment Promotion

```yaml
name: Deploy Pipeline

on:
  push:
    branches: [main]

jobs:
  deploy-staging:
    runs-on: ubuntu-latest
    environment: staging
    
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Staging
        run: |
          curl -X POST "https://api.helipod.io/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.HELIPOD_STAGING_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project": "my-app-staging"}'

  deploy-production:
    needs: deploy-staging
    runs-on: ubuntu-latest
    environment: production
    
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Production
        run: |
          curl -X POST "https://api.helipod.io/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.HELIPOD_PROD_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project": "my-app-production"}'
```

## Cara Alternatif: Webhook

Selain API, Helipod juga support webhook deployment. Kamu bisa trigger deploy dari GitHub Actions tanpa API key:

```yaml
- name: Trigger Helipod Deploy
  run: |
    curl -X POST "${{ secrets.HELIPOD_WEBHOOK_URL }}"
```

Setup webhook:
1. Helipod Dashboard → **Settings** → **Deployments**
2. Copy webhook URL
3. Tambahkan ke GitHub Secrets sebagai `HELIPOD_WEBHOOK_URL`

## Monitoring Deployment

### Cek Status dari GitHub

GitHub Actions menunjukkan status setiap run:
- ✅ Success: deployment berhasil
- ❌ Failed: ada error
- 🔄 In progress: sedang build/deploy

### Cek Status dari Helipod

```
Helipod Dashboard → pilih project → tab Deployments
```

Lihat:
- Build status
- Deploy time
- Commit message
- Author

## Best Practice

### 1. Deploy Hanya dari Main Branch

```yaml
on:
  push:
    branches: [main]  # Hanya deploy dari main
```

### 2. Jalankan Test Sebelum Deploy

```yaml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test
  
  deploy:
    needs: test  # Deploy hanya jika test berhasil
    steps:
      - name: Deploy
        run: ...
```

### 3. Gunakan Environment Variables

```yaml
- name: Deploy
  env:
    HELIPOD_API_KEY: ${{ secrets.HELIPOD_API_KEY }}
  run: |
    curl -X POST "https://api.helipod.io/v1/deploy" \
      -H "Authorization: Bearer $HELIPOD_API_KEY" \
      ...
```

### 4. Cache Dependencies

```yaml
- name: Setup Node.js
  uses: actions/setup-node@v4
  with:
    node-version: '20'
    cache: 'npm'  # Cache npm dependencies
```

### 5. Notification

```yaml
- name: Notify on failure
  if: failure()
  run: |
    curl -X POST "${{ secrets.SLACK_WEBHOOK }}" \
      -d '{"text": "Deploy failed!"}'
```

## Troubleshooting

### "Workflow not triggering"

- Pastikan file ada di `.github/workflows/`
- Pastikan branch name benar
- Cek syntax YAML

### "Deploy failed"

- Cek API key benar
- Cek project name benar
- Cek logs GitHub Actions

### "Build slow"

- Cache dependencies
- Gunakan `npm ci` bukan `npm install`
- Skip test di deploy branch

## FAQ

### Apakah GitHub Actions gratis?

Ya, untuk repo public. Untuk private repo: 2000 menit/bulan gratis.

### Bisa pakai GitLab CI?

Ya. Helipod support GitLab juga. Setup pipeline di `.gitlab-ci.yml`.

### Apakah deploy otomatis dari GitHub?

Ya. Helipod auto-deploy dari GitHub webhook saat push ke branch yang diatur.

### Bagaimana dengan rollback?

Rollback dari Helipod dashboard, satu klik. Tidak perlu rollback dari GitHub Actions.

## Kesimpulan

CI/CD dengan GitHub Actions menghilangkan manual deployment. Push code → otomatis build → test → deploy. Lebih cepat, lebih aman, dan lebih reliable.

Mulai setup di [helipod.io](https://helipod.io), tidak perlu kartu kredit.

Punya pertanyaan? Hubungi kami di [support@helipod.io](mailto:support@helipod.io) atau bergabung ke komunitas di [hangar.helipod.io](https://hangar.helipod.io).
