Skip to content

Commit 7368e82

Browse files
committed
init
0 parents  commit 7368e82

File tree

291 files changed

+392536
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+392536
-0
lines changed

.github/DEPLOYMENT.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# GitHub Actions Deployment Setup
2+
3+
This repository uses GitHub Actions to automatically build and deploy the website to GitHub Pages.
4+
5+
## How It Works
6+
7+
The deployment workflow (`.github/workflows/deploy.yml`) automatically:
8+
9+
1. **Triggers** on every push to the `new-website` branch
10+
2. **Builds** the SvelteKit static site using `npm run build`
11+
3. **Copies** the `build/` directory to `docs/` directory
12+
4. **Creates** a `.nojekyll` file to bypass Jekyll processing
13+
5. **Commits** the changes back to the repository
14+
6. **Pushes** the updated `docs/` directory to GitHub
15+
16+
## Repository Settings Configuration
17+
18+
To enable GitHub Pages deployment, configure the following settings in your repository:
19+
20+
### 1. Enable GitHub Pages
21+
22+
1. Go to your repository on GitHub
23+
2. Navigate to **Settings****Pages**
24+
3. Under **Source**, select:
25+
- **Deploy from a branch**
26+
4. Under **Branch**, select:
27+
- Branch: `new-website` (or your main branch)
28+
- Folder: `/docs`
29+
5. Click **Save**
30+
31+
### 2. Workflow Permissions
32+
33+
The workflow requires write permissions to commit and push changes:
34+
35+
1. Go to **Settings****Actions****General**
36+
2. Scroll to **Workflow permissions**
37+
3. Select **Read and write permissions**
38+
4. Check **Allow GitHub Actions to create and approve pull requests** (optional)
39+
5. Click **Save**
40+
41+
## Manual Deployment
42+
43+
You can also trigger the deployment manually:
44+
45+
1. Go to the **Actions** tab in your repository
46+
2. Click on **Build and Deploy to GitHub Pages**
47+
3. Click **Run workflow**
48+
4. Select the branch and click **Run workflow**
49+
50+
## Local Deployment (Alternative)
51+
52+
If you prefer to deploy manually from your local machine, you can still use:
53+
54+
```bash
55+
make github
56+
```
57+
58+
This will build the site and push the `docs/` directory to GitHub.
59+
60+
## Deployment URL
61+
62+
Once configured, your site will be available at:
63+
64+
```
65+
https://<username>.github.io/<repository-name>/
66+
```
67+
68+
For example:
69+
- `https://yourusername.github.io/www/`
70+
71+
## Troubleshooting
72+
73+
### Deployment fails with permission errors
74+
75+
- Ensure **Workflow permissions** are set to **Read and write**
76+
- Check that the branch name in the workflow matches your repository's default branch
77+
78+
### Site shows 404
79+
80+
- Verify that GitHub Pages source is set to the `docs/` folder
81+
- Check that the `.nojekyll` file exists in the `docs/` directory
82+
- Ensure the `docs/` directory is committed and pushed to the repository
83+
84+
### Build fails
85+
86+
- Check the **Actions** tab for detailed error logs
87+
- Ensure all dependencies are correctly specified in `package.json`
88+
- Verify Node.js version compatibility (requires Node >= 18.12.0)
89+
90+
### Changes not appearing
91+
92+
- GitHub Pages may take a few minutes to update after deployment
93+
- Try hard-refreshing your browser (Ctrl+Shift+R or Cmd+Shift+R)
94+
- Check the **Actions** tab to ensure the workflow completed successfully
95+
96+
## Workflow File Location
97+
98+
The workflow configuration is located at:
99+
```
100+
.github/workflows/deploy.yml
101+
```
102+
103+
You can modify this file to:
104+
- Change the trigger branch
105+
- Add additional build steps
106+
- Modify deployment behavior
107+
- Add environment-specific configurations
108+
109+
## Environment Variables
110+
111+
If your build requires environment variables:
112+
113+
1. Go to **Settings****Secrets and variables****Actions**
114+
2. Click **New repository secret**
115+
3. Add your secrets (e.g., `API_KEY`, `GOOGLE_DOCS_ID`)
116+
4. Reference them in the workflow using `${{ secrets.SECRET_NAME }}`
117+
118+
Example:
119+
```yaml
120+
- name: Build static site
121+
run: npm run build
122+
env:
123+
GOOGLE_DOCS_ID: ${{ secrets.GOOGLE_DOCS_ID }}
124+
```
125+
126+
## Disabling Automatic Deployment
127+
128+
If you want to disable automatic deployment:
129+
130+
1. Go to the **Actions** tab
131+
2. Click on **Build and Deploy to GitHub Pages**
132+
3. Click the **⋮** menu and select **Disable workflow**
133+
134+
Or delete the workflow file:
135+
```bash
136+
rm .github/workflows/deploy.yml
137+
git add .github/workflows/deploy.yml
138+
git commit -m "disable automatic deployment"
139+
git push
140+
```

.github/workflows/deploy.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Deploy when pushing to new-website branch
7+
workflow_dispatch: # Allow manual triggering from GitHub UI
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: write # Required for pushing to the repository
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Fetch all history for proper git operations
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build static site
32+
run: npm run build
33+
34+
- name: Prepare GitHub Pages deployment
35+
run: |
36+
# Remove existing docs directory if it exists
37+
rm -rf docs
38+
39+
# Copy build output to docs directory
40+
cp -r build docs
41+
42+
# Create .nojekyll file to bypass Jekyll processing
43+
touch docs/.nojekyll
44+
45+
- name: Configure Git
46+
run: |
47+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
48+
git config --local user.name "github-actions[bot]"
49+
50+
- name: Commit and push changes
51+
run: |
52+
git add docs
53+
54+
# Only commit if there are changes
55+
if git diff --staged --quiet; then
56+
echo "No changes to commit"
57+
else
58+
git commit -m "update github pages"
59+
git push
60+
fi
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
node_modules
3+
.svelte
4+
.svelte-kit
5+
build
6+
functions
7+
.env
8+
local/
9+
tasks/
10+
HELP.md
11+
AGENTS.md
12+
CLAUDE.md

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
/static
7+
.env
8+
.env.*
9+
!.env.example
10+
11+
# Ignore files for PNPM, NPM and YARN
12+
pnpm-lock.yaml
13+
package-lock.json
14+
yarn.lock

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": true,
3+
"trailingComma": "none",
4+
"printWidth": 80,
5+
"svelteSortOrder": "options-scripts-markup-styles"
6+
}

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Atharva Sehgal
4+
Copyright (c) 2022 The Pudding
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
PHONY: github pudding
2+
3+
github:
4+
rm -rf docs
5+
cp -r build docs
6+
touch docs/.nojekyll
7+
git add -A
8+
git commit -m "update github pages"
9+
git push
10+

0 commit comments

Comments
 (0)