Deploy & Publish¶
Panduan proses build, tagging, dan auto deploy dokumentasi ke production.
Alur Deploy¶
Edit Konten → Git Push → Auto Build → Tag Version → Auto Deploy
| Step | Aksi | Trigger |
|---|---|---|
| 1 | Edit file markdown | Manual |
| 2 | Git commit & push | Manual |
| 3 | Docker image build | Otomatis (setiap push) |
| 4 | Buat tag version | Manual |
| 5 | Deploy ke production | Otomatis (saat tag dibuat) |
Step 1: Edit & Commit¶
Setelah melakukan perubahan, commit dan push:
# Cek perubahan
git status
# Stage file yang berubah
git add docs/path/ke/file.md
# Commit
git commit -m "deskripsi perubahan"
# Push ke repository
git push origin main
Jangan push file besar tanpa perlu
Hindari commit file video (.mp4) atau gambar besar (>1MB) kecuali memang diperlukan. Ini akan memperbesar ukuran repository.
Step 2: Build Otomatis¶
Setelah push, GitLab CI/CD otomatis akan:
- Build Docker image dengan MkDocs
- Push image ke container registry
Proses ini berjalan di background dan tidak perlu intervensi.
Step 3: Deploy ke Production¶
Deploy hanya terjadi saat membuat tag dengan format v*.*.*:
# Buat tag versi baru
git tag v0.3.0
# Push tag
git push origin v0.3.0
Format Versi¶
Gunakan Semantic Versioning:
v[MAJOR].[MINOR].[PATCH]
| Tipe | Kapan Digunakan | Contoh |
|---|---|---|
| MAJOR | Perubahan besar / redesign | v1.0.0 |
| MINOR | Tambah app baru / modul baru | v0.3.0 |
| PATCH | Fix typo, update konten kecil | v0.2.08 |
Cek Tag Terakhir¶
git tag -l --sort=-version:refname | head -5
Step 4: Verifikasi¶
Setelah deploy, cek site production:
- Buka docs.garudea.com
- Pastikan perubahan sudah tampil
- Cek navigasi dan gambar
Waktu Deploy
Deploy biasanya memakan waktu 2-5 menit setelah tag di-push, tergantung ukuran image dan kecepatan server.
Testing Lokal Sebelum Deploy¶
Selalu test secara lokal sebelum push:
Preview dengan MkDocs¶
mkdocs serve
Build Strict (mendeteksi error)¶
mkdocs build --strict
Jika ada warning atau error, perbaiki sebelum push.
Test dengan Docker (opsional)¶
docker build -t garudea-docs-test .
docker run -d -p 8080:80 garudea-docs-test
# Buka http://localhost:8080
Troubleshooting¶
Build gagal¶
ERROR - Config value 'nav': ...
Penyebab: Path file di nav: salah atau file tidak ada. Solusi: Cek path file dan pastikan file .md sudah ada di lokasi yang benar.
Gambar tidak tampil¶
Penyebab: Nama file gambar tidak sesuai dengan referensi di markdown. Solusi: Pastikan nama file gambar sama persis (case-sensitive) dengan yang ditulis di markdown.
Warning MkDocs 2.0¶
WARNING – MkDocs 2.0 is incompatible with Material for MkDocs
Status: Ini hanya informasi, bukan error. Build tetap berhasil. Abaikan untuk saat ini.