Skip to content

Commit f93925c

Browse files
committed
feat: Add GitHub Actions workflow for automatic deployment to GitHub Pages
1 parent a32263e commit f93925c

File tree

2 files changed

+319
-0
lines changed

2 files changed

+319
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main", "master", "dev_v1"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Build job
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v4
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
# Upload entire repository
38+
path: '.'
39+
40+
# Deployment job
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

DEPLOYMENT_GUIDE.md

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
# 🚀 GitHub Pages Deployment Guide
2+
3+
## ✅ Step 1: GitHub Actions Workflow Created!
4+
5+
I've created the GitHub Actions workflow file at:
6+
```
7+
.github/workflows/deploy.yml
8+
```
9+
10+
This workflow will **automatically deploy** your app to GitHub Pages whenever you push to:
11+
- `main` branch
12+
- `master` branch
13+
- `dev_v1` branch (your current branch)
14+
15+
---
16+
17+
## 📋 Step 2: Commit and Push the Workflow File
18+
19+
Run these commands in your terminal:
20+
21+
```bash
22+
# Navigate to your project directory (if not already there)
23+
cd "c:\Users\Ashish jha\Desktop\PERSONAL\CodeToContext"
24+
25+
# Add the workflow file
26+
git add .github/workflows/deploy.yml
27+
28+
# Also add any other changes (logo, icons, etc.)
29+
git add .
30+
31+
# Commit everything
32+
git commit -m "feat: Add GitHub Actions workflow for automatic deployment"
33+
34+
# Push to GitHub
35+
git push origin dev_v1
36+
```
37+
38+
---
39+
40+
## ⚙️ Step 3: Enable GitHub Pages in Repository Settings
41+
42+
### Option A: Using GitHub Actions (Recommended)
43+
44+
1. **Go to your repository on GitHub:**
45+
```
46+
https://github.com/Ashjha75/CocdeToContext
47+
```
48+
49+
2. **Click on "Settings" tab** (top right of your repo)
50+
51+
3. **Scroll down to "Pages"** in the left sidebar
52+
53+
4. **Under "Build and deployment":**
54+
- **Source:** Select **"GitHub Actions"** (NOT "Deploy from a branch")
55+
56+
5. **Save** (if there's a save button)
57+
58+
6. **Wait a few moments** - GitHub Actions will automatically deploy!
59+
60+
### Option B: Manual Verification
61+
62+
After pushing, you can verify the deployment:
63+
64+
1. **Go to "Actions" tab** in your repository
65+
66+
2. **You should see a workflow running** called "Deploy to GitHub Pages"
67+
68+
3. **Wait for the green checkmark** ✅ (usually takes 1-2 minutes)
69+
70+
4. **Your site will be live at:**
71+
```
72+
https://ashjha75.github.io/CocdeToContext/
73+
```
74+
75+
---
76+
77+
## 🎯 What the Workflow Does
78+
79+
```yaml
80+
# Triggers on push to main, master, or dev_v1
81+
on:
82+
push:
83+
branches: ["main", "master", "dev_v1"]
84+
workflow_dispatch: # Allows manual trigger
85+
86+
# Two jobs:
87+
1. Build - Uploads your files
88+
2. Deploy - Publishes to GitHub Pages
89+
```
90+
91+
**Benefits:**
92+
- ✅ Automatic deployment on every push
93+
- ✅ No manual build steps needed
94+
- ✅ Fast deployment (1-2 minutes)
95+
- ✅ Can manually trigger from Actions tab
96+
- ✅ Works with your current branch (dev_v1)
97+
98+
---
99+
100+
## 🔍 Troubleshooting
101+
102+
### Issue 1: Workflow doesn't run
103+
**Solution:**
104+
- Make sure you pushed the `.github/workflows/deploy.yml` file
105+
- Check the "Actions" tab is enabled in repository settings
106+
107+
### Issue 2: Deployment fails
108+
**Solution:**
109+
- Check "Actions" tab for error messages
110+
- Verify GitHub Pages is set to "GitHub Actions" source
111+
- Make sure repository is public (or you have GitHub Pro for private repos)
112+
113+
### Issue 3: Site shows 404
114+
**Solution:**
115+
- Wait 2-3 minutes after deployment completes
116+
- Clear browser cache
117+
- Check the URL is correct: `https://ashjha75.github.io/CocdeToContext/`
118+
119+
---
120+
121+
## 🎨 What Will Be Deployed
122+
123+
Your live site will include all the features we added:
124+
- ✅ Professional logo & favicon
125+
- ✅ 80+ VS Code-style file icons
126+
- ✅ Custom modal dialogs
127+
- ✅ Clear all functionality
128+
- ✅ File tree with proper icons
129+
- ✅ Copy to clipboard
130+
- ✅ Download as TXT
131+
- ✅ Token counter
132+
- ✅ Mobile responsive design
133+
134+
---
135+
136+
## 📱 Sharing Your App
137+
138+
Once deployed, share it with:
139+
140+
### Direct Link
141+
```
142+
https://ashjha75.github.io/CocdeToContext/
143+
```
144+
145+
### Add to README
146+
```markdown
147+
## 🚀 Live Demo
148+
Try it now: [CodeToContext Live App](https://ashjha75.github.io/CocdeToContext/)
149+
```
150+
151+
### Social Media
152+
```
153+
🎉 Check out CodeToContext - Convert your codebase to AI prompts!
154+
🔗 https://ashjha75.github.io/CocdeToContext/
155+
✨ Features: VS Code icons, file tree, token counter, and more!
156+
```
157+
158+
---
159+
160+
## 🔄 Future Updates
161+
162+
Every time you push new changes to `dev_v1`, `main`, or `master`:
163+
1. GitHub Actions automatically runs
164+
2. Your site updates in 1-2 minutes
165+
3. No manual deployment needed!
166+
167+
**Example workflow:**
168+
```bash
169+
# Make changes to your code
170+
# Edit index.html, style.css, or index.js
171+
172+
# Commit and push
173+
git add .
174+
git commit -m "feat: Add new feature"
175+
git push origin dev_v1
176+
177+
# ✨ GitHub Actions deploys automatically!
178+
# Check Actions tab to see progress
179+
# Site updates in ~2 minutes
180+
```
181+
182+
---
183+
184+
## 📊 Monitoring Deployments
185+
186+
### View Deployment Status
187+
1. Go to **Actions** tab in your repo
188+
2. See all past deployments
189+
3. Click on any run to see details
190+
4. Green ✅ = Success, Red ❌ = Failed
191+
192+
### View Live Site
193+
- **Production URL:** `https://ashjha75.github.io/CocdeToContext/`
194+
- **Check status:** Green dot in Pages settings = Live
195+
- **Update time:** Shows last deployment time
196+
197+
---
198+
199+
## ⚡ Quick Reference Commands
200+
201+
```bash
202+
# 1. Commit and push workflow
203+
git add .
204+
git commit -m "feat: Add GitHub Actions workflow"
205+
git push origin dev_v1
206+
207+
# 2. Check status (after push)
208+
# Go to: https://github.com/Ashjha75/CocdeToContext/actions
209+
210+
# 3. Visit your live site
211+
# Open: https://ashjha75.github.io/CocdeToContext/
212+
```
213+
214+
---
215+
216+
## ✅ Deployment Checklist
217+
218+
- [x] Created `.github/workflows/deploy.yml`
219+
- [ ] Committed the workflow file
220+
- [ ] Pushed to GitHub
221+
- [ ] Enabled GitHub Pages in repository settings
222+
- [ ] Set source to "GitHub Actions"
223+
- [ ] Verified workflow runs successfully
224+
- [ ] Checked live site is accessible
225+
- [ ] Tested all features on live site
226+
227+
---
228+
229+
## 🎉 Success Indicators
230+
231+
You'll know everything is working when:
232+
233+
1.**Actions tab shows green checkmark**
234+
2.**Pages settings shows green dot with URL**
235+
3.**Site loads at** `https://ashjha75.github.io/CocdeToContext/`
236+
4.**Logo appears in browser tab and header**
237+
5.**File icons load correctly**
238+
6.**All features work (select folder, generate context, etc.)**
239+
240+
---
241+
242+
## 🆘 Need Help?
243+
244+
If you encounter any issues:
245+
246+
1. **Check Actions tab** for error messages
247+
2. **Look at workflow logs** for specific errors
248+
3. **Verify file paths** are correct
249+
4. **Ensure repository is public** (or GitHub Pro for private)
250+
5. **Wait a few minutes** after enabling Pages
251+
252+
---
253+
254+
## 🚀 You're Ready to Deploy!
255+
256+
Run the commands above and your app will be live in minutes! 🎊
257+
258+
**Next steps:**
259+
1. Copy the commands from "Step 2" above
260+
2. Run them in your terminal
261+
3. Follow "Step 3" to enable GitHub Pages
262+
4. Share your live app with the world! 🌍
263+
264+
**Your live URL will be:**
265+
```
266+
https://ashjha75.github.io/CocdeToContext/
267+
```
268+
269+
Good luck! 🍀

0 commit comments

Comments
 (0)