@@ -10,176 +10,125 @@ This guide will help you deploy your documentation website to GitHub Pages.
1010
1111## Step 1: Enable GitHub Pages
1212
13- 1 . Go to your repository on GitHub
14- 2 . Click on ** Settings** tab
15- 3 . Scroll down to ** Pages** section in the left sidebar
13+ 1 . Go to your repository: https://github.com/Devlander-Software/docs
14+ 2 . Click ** Settings** tab
15+ 3 . Scroll down to ** Pages** in the left sidebar
16164 . Under ** Source** , select ** GitHub Actions**
17175 . Click ** Save**
1818
19- ## Step 2: Configure Repository Settings
19+ ## Step 2: Set Production Branch as Default
2020
21- ### Enable GitHub Actions
22-
23- 1 . Go to ** Settings** → ** Actions** → ** General**
24- 2 . Under ** Workflow permissions** , select ** Allow GitHub Actions to create and approve pull requests**
25- 3 . Click ** Save**
26-
27- ### Configure Pages Settings
28-
29- 1 . Go to ** Settings** → ** Pages**
30- 2 . Under ** Build and deployment** :
31- - ** Source** : Deploy from a branch
32- - ** Branch** : ` gh-pages ` (will be created automatically)
33- - ** Folder** : ` / (root) `
34- 3 . Click ** Save**
21+ 1 . In ** Settings** → ** General**
22+ 2 . Scroll to ** Default branch**
23+ 3 . Ensure it's set to ` production `
24+ 4 . Click ** Update** (if needed)
3525
3626## Step 3: Push Your Code
3727
38- The deployment will happen automatically when you push to the ` main ` branch:
28+ The deployment will happen automatically when you push to the ` production ` branch:
3929
4030``` bash
4131# Add all changes
4232git add .
4333
4434# Commit with conventional commit format
45- git commit -m " feat: add GitHub Pages deployment "
35+ git commit -m " feat: add new documentation "
4636
47- # Push to main branch
48- git push origin main
37+ # Push to production branch
38+ git push origin production
4939```
5040
5141## Step 4: Monitor Deployment
5242
53431 . Go to ** Actions** tab in your repository
54- 2 . You'll see the "Deploy to GitHub Pages" workflow running
55- 3 . Click on it to monitor the progress
56- 4 . Wait for the deployment to complete (usually 2-3 minutes)
44+ 2 . You should see "Deploy to GitHub Pages" workflow running
45+ 3 . Wait for completion (2-3 minutes)
5746
5847## Step 5: Access Your Website
5948
60- Once deployment is complete, your website will be available at:
61-
62- ```
63- https://[your-username].github.io/[repository-name]/
49+ Once deployment is complete, your site will be available at:
6450```
65-
66- For example:
67- ```
68- https://landonjohnson.github.io/docs/
69- ```
70-
71- ## Troubleshooting
72-
73- ### Common Issues
74-
75- 1 . ** Build Fails**
76- - Check the Actions logs for specific errors
77- - Ensure all dependencies are properly installed
78- - Verify TypeScript compilation passes
79-
80- 2 . ** 404 Errors**
81- - Make sure the ` basePath ` in ` next.config.js ` matches your repository name
82- - Check that the ` out ` directory is being generated correctly
83-
84- 3 . ** Styling Issues**
85- - Verify that CSS is being loaded correctly
86- - Check that asset paths are correct for GitHub Pages
87-
88- ### Manual Deployment
89-
90- If automatic deployment fails, you can deploy manually:
91-
92- ``` bash
93- # Build the project
94- npm run build
95-
96- # The built files will be in the `out` directory
97- # You can manually upload these to GitHub Pages
51+ https://devlander-software.github.io/docs/
9852```
9953
10054## Configuration Files
10155
10256### next.config.js
103-
104- The configuration is already set up for GitHub Pages:
105-
10657``` javascript
58+ /** @type {import('next').NextConfig} */
10759const nextConfig = {
108- output: ' export' ,
60+ output: ' export' , // Enable static export
10961 trailingSlash: true ,
11062 basePath: process .env .NODE_ENV === ' production' ? ' /docs' : ' ' ,
11163 assetPrefix: process .env .NODE_ENV === ' production' ? ' /docs' : ' ' ,
64+ // ... other configuration
11265};
11366```
11467
11568### .github/workflows/deploy.yml
69+ ``` yaml
70+ name : Deploy to GitHub Pages
11671
117- The GitHub Actions workflow handles:
118- - Installing dependencies
119- - Running tests and linting
120- - Building the application
121- - Deploying to GitHub Pages
122-
123- ## Custom Domain (Optional)
72+ on :
73+ push :
74+ branches : [ production ] # Deploy from production branch
75+ pull_request :
76+ branches : [ production ]
77+ workflow_dispatch :
12478
125- To use a custom domain:
126-
127- 1 . Go to ** Settings** → ** Pages**
128- 2 . Under ** Custom domain** , enter your domain
129- 3 . Add a ` CNAME ` file to your repository root with your domain
130- 4 . Configure DNS settings with your domain provider
131-
132- ## Environment Variables
133-
134- The following environment variables are used during build:
135-
136- - ` NODE_ENV=production ` - Enables production optimizations
137- - ` GITHUB_PAGES=true ` - Indicates GitHub Pages deployment
79+ # ... rest of workflow configuration
80+ ```
13881
139- ## Performance Optimization
82+ ## Troubleshooting
14083
141- The deployment includes several optimizations:
84+ ### Common Issues
14285
143- - ** Static Export ** : All pages are pre-rendered as static HTML
144- - ** Asset Optimization ** : Images and CSS are optimized
145- - ** Caching ** : Proper cache headers for better performance
146- - ** Compression ** : Assets are compressed for faster loading
86+ 1 . ** Page not found (404) **
87+ - Ensure GitHub Pages is enabled in repository settings
88+ - Check that the repository is public
89+ - Verify the workflow completed successfully
14790
148- ## Security
91+ 2 . ** Build failures**
92+ - Check the Actions tab for error logs
93+ - Ensure all dependencies are in package.json
94+ - Verify TypeScript compilation passes
14995
150- The deployment includes security headers:
96+ 3 . ** Styling issues**
97+ - Check that Tailwind CSS is properly configured
98+ - Verify that all CSS files are being built
15199
152- - ` X-Frame-Options: DENY `
153- - ` X-Content-Type-Options: nosniff `
154- - ` Referrer-Policy: origin-when-cross-origin `
100+ ### Manual Deployment
155101
156- ## Monitoring
102+ If automatic deployment fails, you can manually trigger it:
157103
158- After deployment, monitor your website:
104+ 1 . Go to ** Actions** tab
105+ 2 . Click on "Deploy to GitHub Pages" workflow
106+ 3 . Click ** Run workflow**
107+ 4 . Select ` production ` branch
108+ 5 . Click ** Run workflow**
159109
160- 1 . ** Performance** : Use Lighthouse to check performance scores
161- 2 . ** Accessibility** : Verify WCAG compliance
162- 3 . ** SEO** : Check meta tags and structured data
163- 4 . ** Analytics** : Set up Google Analytics if needed
110+ ## Environment Variables
164111
165- ## Updating Your Website
112+ The following environment variables are used during build:
166113
167- To update your website:
114+ - ` NODE_ENV=production ` - Ensures production build
115+ - ` GITHUB_TOKEN ` - Automatically provided by GitHub Actions
168116
169- 1 . Make your changes locally
170- 2 . Test with ` npm run dev `
171- 3 . Commit and push to ` main ` branch
172- 4 . GitHub Actions will automatically deploy the updates
117+ ## Performance Optimization
173118
174- ## Support
119+ - Images are optimized automatically by Next.js
120+ - CSS is minified and optimized
121+ - JavaScript is bundled and minified
122+ - Static assets are cached by CDN
175123
176- If you encounter issues:
124+ ## Security
177125
178- 1 . Check the GitHub Actions logs
179- 2 . Verify your repository settings
180- 3 . Ensure all dependencies are up to date
181- 4 . Test the build locally with ` npm run build `
126+ - Security headers are automatically added
127+ - HTTPS is enforced
128+ - Content Security Policy is configured
182129
183- ---
130+ ## Monitoring
184131
185- Your documentation website will be live and accessible to anyone with the URL!
132+ - Monitor deployment status in GitHub Actions
133+ - Check website performance with browser dev tools
134+ - Use GitHub's built-in analytics for traffic insights
0 commit comments