Skip to content

Merge main branch#4

Merged
selamet merged 2 commits intogh-pagesfrom
main
Jan 5, 2026
Merged

Merge main branch#4
selamet merged 2 commits intogh-pagesfrom
main

Conversation

@selamet
Copy link
Owner

@selamet selamet commented Jan 5, 2026

Note

Introduces a dedicated Gatsby Pages workflow and streamlines the existing GitHub Pages deployment.

  • Adds /.github/workflows/gatsby.yml with separate build and deploy jobs: auto-detects package manager, uses Node 20, caches .cache/public, builds Gatsby with PREFIX_PATHS, uploads artifact, and deploys via actions/deploy-pages@v4.
  • Reworks /.github/workflows/deploy.yml into a single build-and-deploy job: runs on push and pull_request to main, uses Node 18, builds, removes dist/README.md, and deploys to Pages with peaceiris/actions-gh-pages@v3 (only on main).

Written by Cursor Bugbot for commit 6fd673e. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two workflows deploy to GitHub Pages on main

Both deploy.yml and the newly added gatsby.yml trigger on push to main and deploy to GitHub Pages. deploy.yml uses peaceiris/actions-gh-pages (pushes to gh-pages branch) while gatsby.yml uses actions/deploy-pages (artifact-based deployment). These workflows will race on every push, causing unpredictable deployment behavior where one deployment could immediately overwrite the other or fail due to conflicts.

Additional Locations (1)

Fix in Cursor Fix in Web

if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing write permission for actions-gh-pages deployment

The peaceiris/actions-gh-pages@v3 action requires contents: write permission to push to the gh-pages branch. The workflow removed the permissions block entirely, so it relies on repository default permissions. This can cause the deployment to fail with a permission error if the repository restricts the default GITHUB_TOKEN permissions.

Fix in Cursor Fix in Web

run: npm ci

- name: Build
run: npm run build
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build environment variables removed affecting production optimization

The build step removed the NODE_ENV: production and CI: true environment variables that were present in the original workflow. Many build tools (React, Webpack, etc.) check NODE_ENV to enable production optimizations like minification and dead code elimination. Without NODE_ENV=production, the deployed build may include debug code and lack production optimizations, resulting in larger bundles and slower performance.

Fix in Cursor Fix in Web

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing concurrency settings allow deployment race conditions

The concurrency block was removed from deploy.yml. Without concurrency controls, multiple rapid pushes to main will trigger simultaneous workflow runs. When peaceiris/actions-gh-pages attempts to git-push to the gh-pages branch from concurrent runs, this can cause push conflicts or one deployment silently overwriting another mid-push.

Fix in Cursor Fix in Web

@selamet selamet merged commit 298ac66 into gh-pages Jan 5, 2026
4 checks passed
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.

1 participant