Skip to content

Fix documentation deployment to use gh-pages branch instead of GitHub Pages environment#3

Merged
rafnixg merged 3 commits intomainfrom
copilot/fix-86e94c0b-eb0d-48b7-ae1c-e732be5e505e
Aug 23, 2025
Merged

Fix documentation deployment to use gh-pages branch instead of GitHub Pages environment#3
rafnixg merged 3 commits intomainfrom
copilot/fix-86e94c0b-eb0d-48b7-ae1c-e732be5e505e

Conversation

Copy link
Contributor

Copilot AI commented Aug 23, 2025

Problem

The documentation workflow was deploying to the GitHub Pages environment, which clutters the main branch deployment history. According to the issue, documentation should be deployed to the gh-pages branch while keeping the main branch clean for code review only.

Solution

Modified .github/workflows/docs.yml to deploy built documentation directly to the gh-pages branch using peaceiris/actions-gh-pages@v4 instead of the GitHub Pages environment.

Key Changes

  • Deployment target: Changed from GitHub Pages environment to gh-pages branch
  • Permissions: Simplified from contents: read, pages: write, id-token: write to contents: write
  • Workflow structure: Consolidated from separate build/deploy jobs to single job with conditional deployment
  • Deployment condition: Added github.event_name == 'push' to ensure deployment only on main branch pushes, not PRs

Benefits

  • ✅ Clean main branch - only source code and documentation sources, no deployment artifacts
  • ✅ PRs build documentation for validation but don't deploy
  • ✅ Main branch pushes automatically deploy to gh-pages branch
  • ✅ Documentation remains accessible at the same URL: https://rafnixg.github.io/bcv-api/
  • ✅ Simplified workflow with better separation of concerns

Testing

  • Validated YAML syntax and workflow structure
  • Confirmed MkDocs build process works correctly
  • Verified build artifacts are properly ignored via .gitignore

The workflow will now properly deploy documentation to the gh-pages branch while keeping the main branch focused on clean code review.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 23, 2025 20:13
Co-authored-by: rafnixg <10915285+rafnixg@users.noreply.github.com>
Co-authored-by: rafnixg <10915285+rafnixg@users.noreply.github.com>
Copilot AI changed the title [WIP] modifica el action de la documentacion, se debe desplegar a la rama gh-pages y no a main, en main solo se debe revisar el codigo limpio. Fix documentation deployment to use gh-pages branch instead of GitHub Pages environment Aug 23, 2025
Copilot AI requested a review from rafnixg August 23, 2025 20:15
@rafnixg rafnixg marked this pull request as ready for review August 23, 2025 20:18
@rafnixg rafnixg merged commit af9e5c5 into main Aug 23, 2025
1 check passed
@rafnixg rafnixg deleted the copilot/fix-86e94c0b-eb0d-48b7-ae1c-e732be5e505e branch August 23, 2025 20:24
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

Comments