GitHub Actions CI/CD — ERP Migrasi¶
Dokumentasi workflow GitHub Actions untuk proyek Migrasi ERP Lucky Jaya Group.
Ringkasan Workflow¶
| Workflow | Trigger | Output | Status |
|---|---|---|---|
| Track TODO Progress | Push main/dev (TODO files) |
Artifact .progress.json |
✅ Aktif |
| Docs & Dashboard Pages | Push main/dev, workflow_run |
GitHub Pages deploy | ✅ Aktif |
| Backend CI (terpisah) | Push/PR backend/ |
Build & test | ✅ Aktif |
Alur Arsitektur¶
┌─────────────────────────────────────────────────────────────────┐
│ GitHub Actions Pipeline │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Push TODO*.md → track-todos.yml ──┬──→ Upload artifact │
│ │ (no auto-commit) │
│ │ │
│ workflow_run completed ───────────┼──→ docs-dashboard-pages.yml │
│ │ Build dashboard │
│ │ Deploy GitHub Pages │
│ │
└─────────────────────────────────────────────────────────────────┘
↓
https://zahrasiska.github.io/migrasi/
Workflow Detail¶
Track TODO Progress¶
File: .github/workflows/track-todos.yml
Trigger:
on:
push:
branches: [main, dev]
paths: ['**/TODO*.md', '.github/workflows/track-todos.yml']
workflow_dispatch:
Job:
1. Checkout repository
2. Parse semua TODO*.md → .progress.json
3. Upload artifact (retention 7 hari)
Perubahan penting (2026-05-25): - ❌ Dihapus: Auto-commit ke branch (hindari infinite loop) - ✅ Ditambah: Upload artifact untuk workflow downstream
Artifact:
| Name | Path | Retention |
|------|------|-----------|
| progress-json | .progress.json | 7 days |
| dashboard-files | docs/data/, docs/project-dashboard.md, docs/monitoring/dashboard.html | 7 days |
Docs & Dashboard Pages¶
File: .github/workflows/docs-dashboard-pages.yml
Trigger:
on:
push:
branches: [main, dev]
paths: ['docs/**', 'mkdocs.yml', '.progress.json', 'scripts/**', '**/TODO*.md']
workflow_run:
workflows: [Track TODO Progress]
types: [completed]
workflow_dispatch:
Job:
1. Checkout repository
2. Install Node.js 22 + dependencies
3. Build progress JSON & dashboard HTML
4. Install MkDocs + Material theme
5. Build site → site/
6. Upload artifact → GitHub Pages
Deploy condition:
- Hanya deploy ke GitHub Pages jika push ke main
- Branch dev hanya build (untuk testing)
Output: - Production: https://zahrasiska.github.io/migrasi/ - Dev preview: Tidak deploy (artifact tersedia)
Branch Strategy¶
| Branch | Purpose | Auto-deploy |
|---|---|---|
main |
Production-ready | ✅ GitHub Pages |
dev |
Development, WIP | ❌ Build only |
feature/* |
Feature branches | ❌ No deploy |
Integrasi dengan Hermes (Server Lokal)¶
GitHub Actions tidak menggantikan Hermes cron. Keduanya berjalan paralel:
| Tool | Schedule | Target | Output |
|---|---|---|---|
| GitHub Actions | Push-triggered | GitHub Pages | Dashboard publik |
| Hermes Cron | Senin 08:00 UTC | Telegram | Notifikasi internal |
Hermes job: erp-migrasi-weekly
hermes cron list
# → fc299ce817c6 [active] erp-migrasi-weekly
# Schedule: 0 8 * * 1
# Deliver: telegram:5779925377
Troubleshooting¶
Workflow tidak jalan¶
- Cek Actions tab di GitHub
- Pastikan workflow tidak di-disable
- Verifikasi path filter cocok dengan file yang diubah
Artifact hilang¶
- Retention 7 hari — download sebelum expired
- Workflow run history tetap ada untuk inspeksi
GitHub Pages tidak update¶
- Cek Settings → Pages — source harus
GitHub Actions - Verifikasi
permissions.pages: writedi workflow - Pastikan deploy job condition terpenuhi (
github.ref == 'refs/heads/main')
Infinite loop (auto-commit → push → trigger)¶
Sudah diatasi: Workflow track-todos.yml tidak lagi auto-commit.
Jika perlu commit manual:
# Tambah step ini dengan hati-hati
- name: Commit progress (manual)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .progress.json
git commit -m "chore: update progress [skip ci]" || true
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Risiko: Loop jika tidak ada [skip ci] atau branch protection.
Referensi¶
Terakhir diperbarui: 2026-05-25 — refaktor workflow (no auto-commit).