Skip to content

Commit 05d05c1

Browse files
committed
Update documentation: gh-pages now contains build files only
- Updated README.md to clarify gh-pages branch structure - Updated DEPLOY_MANUAL.md with detailed workflow explanation - Updated DEPLOYMENT_WORKFLOW.md with clean deploy process - Updated QUICK_REFERENCE.md with simplified commands - All documentation now emphasizes that gh-pages contains only build output
1 parent 8b227fa commit 05d05c1

4 files changed

Lines changed: 112 additions & 71 deletions

File tree

README.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Repository ini berisi source code untuk website resmi KonXC. Website ini dibangu
1010
- **Astro** - Static site generator
1111
- **Tailwind CSS** - CSS framework
1212
- **pnpm** - Package manager
13-
- **GitHub Pages** - Hosting platform
13+
- **GitHub Pages** - Hosting platform (manual deployment)
1414

1515
## 🚀 Quick Start
1616

@@ -50,37 +50,20 @@ Website akan tersedia di `http://localhost:4321`
5050

5151
Karena masalah billing dengan GitHub Actions, deployment dilakukan secara manual menggunakan script yang telah disediakan.
5252

53+
**Branch gh-pages hanya berisi hasil build**, tidak ada source code!
54+
5355
### Cara Deploy Manual
5456

55-
#### Menggunakan Script (Recommended)
5657
```bash
57-
# Linux/macOS
58-
./scripts/deploy-manual.sh
59-
60-
# Windows (Git Bash/WSL)
61-
./scripts/deploy-manual.bat
58+
# Linux/macOS/Windows (Git Bash)
59+
bash ./scripts/deploy-manual.sh
6260
```
6361

64-
#### Manual Step-by-Step
65-
```bash
66-
# 1. Pastikan di branch main dan pull latest changes
67-
git checkout main
68-
git pull origin main
69-
70-
# 2. Install dependencies dan build
71-
pnpm install
72-
pnpm run build
73-
74-
# 3. Deploy ke branch gh-pages
75-
git checkout gh-pages
76-
cp -r dist/* .
77-
git add .
78-
git commit -m "Deploy: $(date '+%Y-%m-%d %H:%M:%S') - Manual deployment"
79-
git push origin gh-pages
80-
81-
# 4. Kembali ke main
82-
git checkout main
83-
```
62+
Script akan otomatis:
63+
1. Pull latest changes dari main
64+
2. Build project
65+
3. **Deploy hanya hasil build** ke branch gh-pages
66+
4. Push ke GitHub Pages
8467

8568
### 📚 Dokumentasi Lengkap
8669
Lihat [docs/DEPLOY_MANUAL.md](./docs/DEPLOY_MANUAL.md) untuk dokumentasi deploy yang lebih detail.
@@ -95,18 +78,24 @@ Lihat [docs/DEPLOY_MANUAL.md](./docs/DEPLOY_MANUAL.md) untuk dokumentasi deploy
9578
│ └── components/ # Reusable components
9679
├── scripts/ # Deployment scripts
9780
├── docs/ # Documentation
81+
├── dist/ # Build output (git ignored)
9882
├── astro.config.mjs # Astro configuration
9983
├── tailwind.config.js # Tailwind configuration
10084
└── package.json # Dependencies
10185
```
10286

87+
### Branch Structure
88+
- **main**: Development branch (source code)
89+
- **gh-pages**: Deployment branch (build files only)
90+
10391
## 🔧 Maintenance Guide
10492

10593
### Untuk Tim Development
10694

10795
1. **Development Workflow**:
10896
- Buat perubahan di branch `main`
10997
- Test lokal dengan `pnpm dev`
98+
- Test build dengan `pnpm build`
11099
- Deploy menggunakan script manual
111100

112101
2. **Update Content**:
@@ -122,13 +111,14 @@ Lihat [docs/DEPLOY_MANUAL.md](./docs/DEPLOY_MANUAL.md) untuk dokumentasi deploy
122111
- [ ] Pastikan perubahan sudah di-commit di branch main
123112
- [ ] Test build lokal dengan `pnpm build`
124113
- [ ] Jalankan script deploy manual
125-
- [ ] Verifikasi website di https://www.konxc.space
114+
- [ ] Verifikasi website di https://www.konxc.space (tunggu 2-5 menit)
126115

127116
### Troubleshooting
128117

129118
- **Build Error**: Periksa syntax Astro dan dependencies
130119
- **Deploy Error**: Pastikan pnpm terinstall dan script executable
131-
- **Website tidak update**: Tunggu beberapa menit, GitHub Pages butuh waktu
120+
- **Website tidak update**: Tunggu 2-5 menit, GitHub Pages butuh waktu
121+
- **Lihat dokumentasi lengkap**: `docs/TROUBLESHOOTING.md`
132122

133123
## 📞 Support
134124

@@ -139,4 +129,4 @@ Untuk pertanyaan atau masalah:
139129

140130
## 📄 License
141131

142-
Repository ini adalah milik KonXC. Semua hak cipta dilindungi.
132+
Repository ini adalah milik KonXC. Semua hak cipta dilindungi.

docs/DEPLOYMENT_WORKFLOW.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@
2727
- Commit dan push perubahan ke repository
2828

2929
### 2. Deployment Phase
30-
- Jalankan script deploy manual: `./scripts/deploy-manual.sh`
30+
- Jalankan script deploy manual: `bash ./scripts/deploy-manual.sh`
3131
- Script akan:
3232
- Pull latest changes dari main
3333
- Install dependencies dengan pnpm
34-
- Build project dengan Astro
34+
- Build project dengan Astro ke folder `dist/`
35+
- Copy built files ke temporary directory
3536
- Switch ke branch gh-pages
36-
- Copy built files ke root
37+
- **Hapus semua file lama** di gh-pages
38+
- **Copy hanya hasil build** dari temporary directory
3739
- Commit dan push ke gh-pages branch
40+
- Kembali ke branch main
3841

3942
### 3. GitHub Pages Deployment
4043
- GitHub Pages otomatis detect perubahan di branch gh-pages
@@ -52,9 +55,11 @@
5255
## ⚠️ Important Notes
5356

5457
- **Branch Separation**: Main untuk development, gh-pages untuk deployment
58+
- **Build Only**: Branch gh-pages **hanya berisi hasil build**, tidak ada source code
5559
- **Manual Process**: Deployment harus dilakukan secara manual
5660
- **Script Dependency**: Pastikan pnpm dan Node.js terinstall
57-
- **Timing**: GitHub Pages butuh waktu untuk update
61+
- **Timing**: GitHub Pages butuh waktu 2-5 menit untuk update
62+
- **Clean Deploy**: Setiap deploy membersihkan gh-pages terlebih dahulu
5863

5964
## 🛠️ Maintenance
6065

docs/DEPLOY_MANUAL.md

Lines changed: 79 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Dokumentasi ini menjelaskan cara melakukan deploy manual untuk website www.konxc.space menggunakan script yang telah disediakan. Script ini dibuat sebagai alternatif dari GitHub Actions karena masalah billing.
66

7+
**Penting**: Branch `gh-pages` **hanya berisi hasil build** dari folder `dist/`, tidak ada file source code.
8+
79
## 🛠️ Prerequisites
810

911
Sebelum melakukan deploy, pastikan Anda telah menginstall:
@@ -22,7 +24,7 @@ Sebelum melakukan deploy, pastikan Anda telah menginstall:
2224
#### Untuk Linux/macOS:
2325
```bash
2426
# Jalankan script deploy
25-
./scripts/deploy-manual.sh
27+
bash ./scripts/deploy-manual.sh
2628
```
2729

2830
#### Untuk Windows (Git Bash/WSL):
@@ -31,6 +33,22 @@ Sebelum melakukan deploy, pastikan Anda telah menginstall:
3133
./scripts/deploy-manual.bat
3234
```
3335

36+
### Apa yang Dilakukan Script?
37+
38+
Script akan secara otomatis:
39+
1. ✅ Checkout ke branch `main` dan pull latest changes
40+
2. ✅ Install dependencies dengan `pnpm install`
41+
3. ✅ Build project dengan `pnpm run build`
42+
4. ✅ Copy hasil build ke temporary directory
43+
5. ✅ Checkout ke branch `gh-pages` (atau buat jika belum ada)
44+
6.**Hapus semua file lama** di gh-pages
45+
7.**Copy hanya hasil build** dari temporary directory
46+
8. ✅ Tambahkan file `.nojekyll` untuk GitHub Pages
47+
9. ✅ Commit dan push ke branch `gh-pages`
48+
10. ✅ Kembali ke branch `main`
49+
50+
**Hasil**: Branch `gh-pages` hanya berisi file-file hasil build (HTML, CSS, JS, assets) tanpa source code.
51+
3452
### Metode 2: Manual Step-by-Step
3553

3654
Jika script tidak berfungsi, Anda bisa melakukan deploy secara manual:
@@ -40,28 +58,37 @@ Jika script tidak berfungsi, Anda bisa melakukan deploy secara manual:
4058
git checkout main
4159
git pull origin main
4260

43-
# 2. Install dependencies
61+
# 2. Install dependencies dan build
4462
pnpm install
45-
46-
# 3. Build project
4763
pnpm run build
4864

49-
# 4. Switch ke branch gh-pages (atau buat jika belum ada)
65+
# 3. Copy dist ke temporary location
66+
cp -r dist /tmp/konxc-deploy
67+
68+
# 4. Switch ke branch gh-pages
5069
git checkout gh-pages
51-
# atau jika branch belum ada:
52-
# git checkout --orphan gh-pages
70+
git config pull.rebase false
71+
git pull origin gh-pages
5372

54-
# 5. Copy semua file dari dist ke root
55-
cp -r dist/* .
56-
cp dist/.* . 2>/dev/null || true
73+
# 5. Hapus semua file kecuali .git
74+
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} +
5775

58-
# 6. Commit dan push
59-
git add .
60-
git commit -m "Deploy: $(date '+%Y-%m-%d %H:%M:%S') - Manual deployment"
61-
git push origin gh-pages
76+
# 6. Copy hanya hasil build
77+
cp -r /tmp/konxc-deploy/* .
78+
79+
# 7. Tambahkan .nojekyll
80+
touch .nojekyll
81+
82+
# 8. Commit dan push
83+
git add -A
84+
git commit -m "Deploy: $(date '+%Y-%m-%d %H:%M:%S')"
85+
git push -u origin gh-pages
6286

63-
# 7. Kembali ke branch main
87+
# 9. Kembali ke main
6488
git checkout main
89+
90+
# 10. Cleanup
91+
rm -rf /tmp/konxc-deploy
6592
```
6693

6794
## 🔧 Troubleshooting
@@ -84,34 +111,61 @@ Pastikan Anda berada di direktori root proyek (yang berisi file package.json).
84111
chmod +x scripts/deploy-manual.sh
85112
```
86113

114+
### Error: "Your local changes would be overwritten"
115+
```bash
116+
# Commit perubahan di main terlebih dahulu
117+
git add .
118+
git commit -m "Your commit message"
119+
```
120+
87121
### Website tidak update setelah deploy
88-
- GitHub Pages membutuhkan waktu beberapa menit untuk update
122+
- GitHub Pages membutuhkan waktu 2-5 menit untuk update
89123
- Pastikan branch `gh-pages` sudah di-push dengan benar
124+
- Clear browser cache (Ctrl+F5 atau Cmd+Shift+R)
90125
- Periksa pengaturan GitHub Pages di repository settings
91126

92127
## 📁 Struktur Branch
93128

94-
- **main**: Branch utama untuk development
95-
- **gh-pages**: Branch untuk deployment (otomatis dibuat oleh script)
129+
- **main**: Branch utama untuk development (berisi source code lengkap)
130+
- **gh-pages**: Branch untuk deployment (hanya berisi hasil build dari `dist/`)
131+
132+
### Contoh isi branch gh-pages:
133+
```
134+
gh-pages/
135+
├── _astro/ # CSS dan assets yang di-bundle
136+
│ └── index.*.css
137+
├── .nojekyll # File untuk GitHub Pages
138+
├── CNAME # Custom domain (jika ada)
139+
├── favicon.svg # Favicon
140+
├── index.html # HTML pages
141+
└── robots.txt # Robots.txt
142+
```
143+
144+
**Tidak ada**: `package.json`, `node_modules`, `src/`, `astro.config.mjs`, dll.
96145

97146
## 🔄 Workflow Development
98147

99148
1. **Development**: Buat perubahan di branch `main`
100149
2. **Testing**: Test lokal dengan `pnpm dev`
101-
3. **Deploy**: Jalankan script deploy manual
102-
4. **Verification**: Periksa website di https://www.konxc.space
150+
3. **Build**: Test build dengan `pnpm build`
151+
4. **Deploy**: Jalankan script deploy manual
152+
5. **Verification**: Periksa website di https://www.konxc.space
103153

104154
## 📝 Catatan Penting
105155

106-
- Script akan otomatis membuat branch `gh-pages` jika belum ada
107-
- Script akan otomatis kembali ke branch `main` setelah deploy
108-
- Pastikan tidak ada perubahan yang belum di-commit sebelum deploy
109-
- Website akan tersedia di https://www.konxc.space setelah deploy
156+
- ✅ Script menggunakan temporary directory untuk keamanan
157+
- ✅ Branch gh-pages selalu dibersihkan sebelum deploy baru
158+
- ✅ Hanya hasil build yang di-deploy, tidak ada source code
159+
- ✅ File `.nojekyll` ditambahkan otomatis
160+
- ✅ Script akan kembali ke main setelah deploy
161+
- ⚠️ Pastikan tidak ada perubahan yang belum di-commit sebelum deploy
162+
- ⚠️ Website akan tersedia di https://www.konxc.space setelah 2-5 menit
110163

111164
## 🆘 Support
112165

113166
Jika mengalami masalah:
114167
1. Periksa troubleshooting di atas
115168
2. Pastikan semua prerequisites terinstall
116169
3. Periksa log error yang muncul
117-
4. Hubungi tim development jika masalah berlanjut
170+
4. Lihat `docs/TROUBLESHOOTING.md` untuk masalah umum
171+
5. Hubungi tim development jika masalah berlanjut

docs/QUICK_REFERENCE.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,12 @@
33
## 🚀 Quick Deploy Commands
44

55
```bash
6-
# Linux/macOS
7-
./scripts/deploy-manual.sh
8-
9-
# Windows (Git Bash/WSL)
10-
./scripts/deploy-manual.bat
11-
12-
# Manual (if scripts fail)
13-
git checkout main && git pull origin main
14-
pnpm install && pnpm run build
15-
git checkout gh-pages && cp -r dist/* .
16-
git add . && git commit -m "Deploy: $(date)"
17-
git push origin gh-pages && git checkout main
6+
# Semua Platform (Linux/macOS/Windows Git Bash)
7+
bash ./scripts/deploy-manual.sh
188
```
199

10+
**Important**: Branch gh-pages hanya berisi hasil build, tidak ada source code!
11+
2012
## 🔧 Development Commands
2113

2214
```bash

0 commit comments

Comments
 (0)