test: add frontend test suite
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 43s

This commit is contained in:
TerryM
2026-05-16 18:21:37 +08:00
parent f59d1e8e2a
commit a29ec8ed92
17 changed files with 1624 additions and 12 deletions

View File

@@ -19,23 +19,24 @@ on:
2. Install dependencies with `npm ci`.
3. Type check with `npx tsc --noEmit`.
4. Check formatting with `npm run format:check`.
5. Build with `npm run build` using:
5. Run tests with `npm test`.
6. Build with `npm run build` using:
```bash
VITE_API_URL=https://api.ark-library.com
VITE_DISABLE_ADMIN=true
```
6. Configure SSH key from `DEPLOY_KEY` secret.
7. `rsync --delete` built `dist/` to both frontend servers:
7. Configure SSH key from `DEPLOY_KEY` secret.
8. `rsync --delete` built `dist/` to both frontend servers:
```text
ec2-user@FRONTEND_1_HOST:/var/www/ark-library/
ec2-user@FRONTEND_2_HOST:/var/www/ark-library/
```
8. Verify both servers have matching `index.html` SHA-256 checksums.
9. Remove temporary SSH key.
9. Verify both servers have matching `index.html` SHA-256 checksums.
10. Remove temporary SSH key.
## Required repository secrets