Skip to content

feat: Configure GitHub Pages deployment for Docusaurus website#68

Merged
Nliver merged 3 commits intoblogfrom
blog-gh-pages-deployment
Jan 29, 2026
Merged

feat: Configure GitHub Pages deployment for Docusaurus website#68
Nliver merged 3 commits intoblogfrom
blog-gh-pages-deployment

Conversation

@xgopilot
Copy link
Copy Markdown

@xgopilot xgopilot bot commented Jan 29, 2026

Requested by @Nliver

This PR sets up automated GitHub Pages deployment for the Docusaurus website. It removes PR #57 commits as requested and provides a clean deployment configuration.

Changes

1. Clean Branch State

2. Removed Conflicting Files

  • Removed astro.config.mjs (conflicts with Docusaurus)
  • Removed Astro page components from src/pages/:
    • blog/[slug].astro
    • blog/index.astro
    • blog/tag/[tag].astro
    • index.astro
  • Removed rss.xml.js (imports Astro dependencies)

These files were causing build errors. The Docusaurus build now succeeds.

3. GitHub Actions Workflow

Note: Due to GitHub App permissions, the workflow file cannot be pushed via this PR. A repository maintainer with workflow permissions needs to manually create the file.

Please create .github/workflows/deploy.yml with the following content:

name: Deploy to GitHub Pages

on:
  push:
    branches:
      - blog
    paths:
      - 'website/**'
      - '.github/workflows/deploy.yml'
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    name: Build Docusaurus
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
          cache-dependency-path: website/package-lock.json

      - name: Install dependencies
        working-directory: website
        run: npm ci

      - name: Build website
        working-directory: website
        run: npm run build

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: website/build

  deploy:
    name: Deploy to GitHub Pages
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: \${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

Repository Settings Required

After merging this PR, a repository administrator needs to:

  1. Add the workflow file (see above)

  2. Configure GitHub Pages:

    • Go to SettingsPages
    • Under Source, select GitHub Actions
    • Save the settings
  3. Trigger deployment:

    • Push a change to the blog branch, or
    • Manually trigger the workflow from the Actions tab

Site URL

After deployment, the site will be available at:

Verification

What This PR Does NOT Include

This PR does not include:

The focus is purely on enabling GitHub Pages deployment infrastructure.

- Removed astro.config.mjs (conflicts with Docusaurus)
- Removed Astro page components from src/pages/
- Removed rss.xml.js that imports Astro dependencies
- Verified Docusaurus build succeeds after cleanup

These Astro files were causing build errors with Docusaurus.
The site now builds successfully with pure Docusaurus setup.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Nliver <34496563+Nliver@users.noreply.github.com>
@Nliver
Copy link
Copy Markdown
Collaborator

Nliver commented Jan 29, 2026

/code

1. Slug Format

Correct: what-makes-ai-application-complete
Wrong: /blog/2025/what-makes-ai-application-complete

→ Slugs must be plain kebab-case strings without path prefixes or year segments.


2. Image Resources Migration

  • Move all images to website/static/img/ (or appropriate asset folder)
  • Update image references in articles:
    ![alt](/img/filename.png)
  • Verify no broken links after migration

📤 Expected Output

  • Clean kebab-case slugs in frontmatter
  • All images migrated and paths corrected
  • Local verification: npm run start → all posts render correctly with images

@xgopilot
Copy link
Copy Markdown
Author

xgopilot bot commented Jan 29, 2026

✅ Task Completed

I've successfully completed all the requirements from your request.

Summary of Changes

1. Slug Format

  • Fixed 21 blog posts with incorrect slug format
  • Changed from /blog/2025/slug-name to slug-name (plain kebab-case)
  • Examples:
    • /blog/2025/what-makes-ai-application-completewhat-makes-ai-application-complete
    • /blog/2025/engineer-core-competitiveness-in-ai-eraengineer-core-competitiveness-in-ai-era

2. Image Resources

  • All images were already correctly migrated to website/static/img/blog/
  • All image references already using correct format: ![alt](/img/blog/folder/image.png)
  • No changes needed for images

3. Verification

  • Build: npm run build completed successfully
  • Dev Server: npm run start started successfully at http://localhost:3000/techcamp/
  • All blog posts render correctly with images

Files Modified

21 blog post files in website/blog/ were updated with corrected slug formats.

Next Steps

The changes have been committed and pushed to the blog-gh-pages-deployment branch. You can now:

  1. Test the site by running npm run start in the website/ directory
  2. Verify all blog posts load correctly with images
  3. Merge this PR when ready

- Changed slug format from '/blog/2025/slug-name' to 'slug-name'
- Updated 21 blog posts to use clean kebab-case slugs
- Images already correctly placed in website/static/img/blog/
- Build and dev server verified successfully

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Nliver <34496563+Nliver@users.noreply.github.com>
@Nliver
Copy link
Copy Markdown
Collaborator

Nliver commented Jan 29, 2026

/code Resolve the merge conflicts by keeping your commits and removing the old content.

@xgopilot
Copy link
Copy Markdown
Author

xgopilot bot commented Jan 29, 2026

✅ Merge Conflicts Resolved

Successfully merged origin/blog into blog-gh-pages-deployment branch and resolved all conflicts as requested.

What Was Done

1. Conflict Resolution Strategy

2. Files Affected

  • Resolved slug conflicts in 11 blog post files (kept our kebab-case format)
  • Accepted deletion of old migration scripts and article formats
  • Merged file renames and reorganizations from origin/blog

3. Verification

  • ✅ Build succeeded: npm run build completed without errors
  • ✅ All blog posts using correct slug format (kebab-case without path prefixes)
  • ✅ Changes pushed to blog-gh-pages-deployment branch

Summary

The merge conflicts have been resolved by keeping your commits (slug standardization) and removing the old content from PR #57. The branch is now ready for the PR to be merged into blog.

- Kept slug format changes from this branch (kebab-case without /blog/2025/ prefix)
- Removed old content and migration scripts from origin/blog
- Resolved all merge conflicts by keeping our changes

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Nliver <34496563+Nliver@users.noreply.github.com>
@Nliver Nliver merged commit 0cdbbef into blog Jan 29, 2026
@Nliver Nliver deleted the blog-gh-pages-deployment branch January 29, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants