Skip to content

Commit f33cdbf

Browse files
Remove duplicate workflow, keep pages.yml
- Delete deploy.yml (duplicate) - Keep pages.yml as single workflow - Build project
1 parent 5e98588 commit f33cdbf

File tree

9 files changed

+1765
-60
lines changed

9 files changed

+1765
-60
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ node_modules/
211211
npm-debug.log*
212212
yarn-debug.log*
213213
yarn-error.log*
214-
package-lock.json
215214
yarn.lock
216215

217216
# TypeScript

DEPLOY.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Deployment Guide
2+
3+
## Pre-Deployment Testing
4+
5+
Run these commands to test locally before deploying:
6+
7+
```bash
8+
# 1. Typecheck (verify TypeScript)
9+
npm run typecheck
10+
11+
# 2. Build
12+
npm run build
13+
14+
# 3. Test web app locally
15+
npm run serve:dist
16+
# Then open http://localhost:3000 (or the URL shown)
17+
18+
# 4. Test CLI
19+
node dist/cli/index.js pwd --len 16
20+
```
21+
22+
## Automated Deployment
23+
24+
The project uses GitHub Actions to automatically build and deploy to GitHub Pages.
25+
26+
### Setup (One-time)
27+
28+
1. **Enable GitHub Pages in repository settings:**
29+
- Go to: Settings → Pages
30+
- Source: Select "GitHub Actions"
31+
32+
2. **Push to main branch:**
33+
```bash
34+
git add .
35+
git commit -m "Build and deploy to GitHub Pages"
36+
git push origin main
37+
```
38+
39+
### What Happens on Push
40+
41+
1. GitHub Actions workflow (`.github/workflows/pages.yml`) triggers
42+
2. Runs `npm ci` to install dependencies
43+
3. Runs `npm run typecheck` to verify TypeScript
44+
4. Runs `npm run build` to create `dist/` folder
45+
5. Uploads `dist/` as artifact
46+
6. Deploys to GitHub Pages
47+
48+
### Verify Deployment
49+
50+
1. Check Actions tab in GitHub repository
51+
2. Wait for workflow to complete (green checkmark)
52+
3. Visit your GitHub Pages URL (usually: `https://<username>.github.io/<repo-name>/`)
53+
54+
## Manual Testing Checklist
55+
56+
- [ ] Password generation works (all modes)
57+
- [ ] User ID generation works (CVC and Words)
58+
- [ ] Share links work (copy and restore)
59+
- [ ] Word lists load correctly
60+
- [ ] Entropy calculation displays
61+
- [ ] Crack time estimation displays
62+
- [ ] All tabs switch correctly
63+
64+
## Troubleshooting
65+
66+
### Build fails locally
67+
- Run `npm install` to ensure dependencies are installed
68+
- Check `tsconfig.json` is correct
69+
- Verify all source files are in `src/` directory
70+
71+
### GitHub Actions fails
72+
- Check Actions tab for error messages
73+
- Verify `package.json` has correct scripts
74+
- Ensure `.github/workflows/pages.yml` exists
75+
76+
### Pages not updating
77+
- Wait a few minutes after push
78+
- Check Actions tab to see if workflow completed
79+
- Verify Pages source is set to "GitHub Actions" (not "main branch")

build-commit-push.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd /Users/alena/Password-Generator
5+
6+
echo "🔨 Step 1: Building project..."
7+
npm run build
8+
9+
echo ""
10+
echo "✅ Build complete! Checking git status..."
11+
git status --short
12+
13+
echo ""
14+
echo "📦 Step 2: Adding all changes..."
15+
git add .
16+
17+
echo ""
18+
echo "💾 Step 3: Committing changes..."
19+
git commit -m "Remove duplicate workflow, keep pages.yml
20+
21+
- Delete deploy.yml (duplicate)
22+
- Keep pages.yml as single workflow
23+
- Build project"
24+
25+
echo ""
26+
echo "🚀 Step 4: Pushing to remote..."
27+
git push
28+
29+
echo ""
30+
echo "✅ Done! GitHub Actions will now build and deploy to Pages."

commit-and-push.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
cd /Users/alena/Password-Generator
3+
git add package-lock.json .gitignore
4+
git commit -m "Add package-lock.json and update .gitignore"
5+
git push

do-build-commit-push.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env node
2+
3+
import { execSync } from 'child_process';
4+
import { existsSync } from 'fs';
5+
6+
const projectRoot = '/Users/alena/Password-Generator';
7+
8+
process.chdir(projectRoot);
9+
10+
console.log('🔨 Step 1: Building project...');
11+
try {
12+
execSync('npm run build', { stdio: 'inherit', cwd: projectRoot });
13+
console.log('✅ Build complete!');
14+
} catch (error) {
15+
console.error('❌ Build failed:', error.message);
16+
process.exit(1);
17+
}
18+
19+
console.log('\n📦 Step 2: Adding all changes...');
20+
try {
21+
execSync('git add .', { stdio: 'inherit', cwd: projectRoot });
22+
} catch (error) {
23+
console.error('❌ Git add failed:', error.message);
24+
process.exit(1);
25+
}
26+
27+
console.log('\n💾 Step 3: Committing changes...');
28+
try {
29+
execSync('git commit -m "Remove duplicate workflow, keep pages.yml\n\n- Delete deploy.yml (duplicate)\n- Keep pages.yml as single workflow\n- Build project"', { stdio: 'inherit', cwd: projectRoot });
30+
} catch (error) {
31+
// Commit might fail if there's nothing to commit
32+
if (error.message.includes('nothing to commit')) {
33+
console.log('ℹ️ Nothing to commit (working tree clean)');
34+
} else {
35+
console.error('❌ Git commit failed:', error.message);
36+
process.exit(1);
37+
}
38+
}
39+
40+
console.log('\n🚀 Step 4: Pushing to remote...');
41+
try {
42+
execSync('git push', { stdio: 'inherit', cwd: projectRoot });
43+
console.log('\n✅ Done! GitHub Actions will now build and deploy to Pages.');
44+
} catch (error) {
45+
console.error('❌ Git push failed:', error.message);
46+
process.exit(1);
47+
}

0 commit comments

Comments
 (0)