GitHub Actions CI/CD Setup
Project ini menggunakan GitHub Actions untuk otomasi testing dan deployment dokumentasi.
Workflows​
1. Playwright Tests (playwright.yml)​
Trigger: Push/PR ke branch main atau master dengan perubahan di:
app/tests/**app/helpers/**playwright.config.tspackage.json
Proses:
- Install dependencies
- Install Playwright browsers
- Run semua test suites
- Copy test report ke
documentation/static/test-reports/ - Commit dan push test reports (dengan
[skip ci]tag) - Upload artifacts (playwright-report, test-results)
2. Deploy Docusaurus (deploy-docs.yml)​
Trigger: Push to branch main/master dengan perubahan di:
documentation/**package.json
Proses:
- Install dependencies
- Build Docusaurus
- Upload build artifacts
- Deploy ke GitHub Pages
3. Auto Deploy with Test Reports (test-reports-deploy.yml)​
Trigger: Push dengan perubahan di:
documentation/static/test-reports/**
Proses:
- Install dependencies
- Build Docusaurus dengan test reports terbaru
- Deploy ke GitHub Pages
Alur Otomasi​
Push ke main/master
↓
├─→ Playwright Tests berjalan
│ ├─→ Tests executed
│ ├─→ Report di-copy ke docs
│ └─→ Commit & push report (triggers test-reports-deploy)
│
├─→ Deploy Docusaurus (jika docs berubah)
│ └─→ Build & Deploy ke GitHub Pages
│
└─→ Auto Deploy with Reports (jika reports berubah)
└─→ Build & Deploy ke GitHub Pages
Environment Variables​
Tidak ada environment variables khusus yang diperlukan. GitHub Actions secara otomatis providing GITHUB_TOKEN untuk push dan deploy.
Important Notes​
[skip ci]tag digunakan saat commit test reports untuk menghindari infinite loops- Artifacts disimpan untuk debugging (retention: 5-30 hari)
- Custom domain:
docu-test.panduanqa.blog - Jobs berjalan di
ubuntu-latest
Local Testing sebelum Push​
Sebelum push ke repository:
# Run tests locally
pnpm test
# Build documentation
cd documentation && pnpm build
# Preview build
cd documentation && pnpm preview
Troubleshooting​
Test report tidak ter-update di Docusaurus​
- Pastikan
playwright.ymlberhasil run tanpa error - Check GitHub Actions logs
- Verify test reports ada di
documentation/static/test-reports/
Deploy gagal​
- Check error di GitHub Actions logs
- Verify
CNAMEfile didocumentation/static/sudah benar - Pastikan branch protection rules tidak block automated commits
[skip ci] tidak bekerja​
- Verifikasi commit message tepat:
[skip ci] - Check branch protection rules