Prepare site for live deployment#2340
Conversation
- Updated `next.config.mjs` to set a static output mode and removed the conditional output based on environment variables. - Simplified the build process in the GitHub Actions workflow by changing the build command to `yarn build`. - Removed the `redirects.json` file and associated logic from the `check-links.mjs` script to streamline route inventory processing. - Updated `package.json` to reflect changes in build scripts and added necessary dependencies for the new setup.
- Created a new workflow in `deploy.yml` to automate the deployment of documentation using Nextra. - Configured the workflow to trigger on pushes to the main branch and allow manual dispatch. - Set up steps for checking out the repository, installing dependencies, generating files, building the static site, and deploying to GitHub Pages with custom domain support.
Summary of ChangesHello @gbarros, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the documentation site's build and deployment infrastructure to prepare it for live deployment. The changes focus on simplifying the static export process, automating deployments via GitHub Actions, and removing complex custom redirect handling in favor of a more straightforward setup. This streamlines the development workflow and ensures a consistent, maintainable static site. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR prepares the documentation site for live deployment by simplifying the build process to use static exports exclusively and automating deployment to GitHub Pages. The changes eliminate conditional export logic and custom redirect handling in favor of a more maintainable static-first approach.
Key changes:
- Automated GitHub Pages deployment workflow with custom domain support
- Simplified Next.js configuration to always use static export mode
- Removed redirect handling system and cleaned up related dependencies
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/deploy.yml |
New workflow to build and deploy static site to GitHub Pages with custom domain |
.github/workflows/preview.yaml |
Updated to use standard build command instead of custom static build script |
next.config.mjs |
Removed conditional export logic, redirect handling, and unused imports |
package.json |
Updated build scripts for static-only workflow and added serve package |
redirects.json |
Removed redirect configuration file |
scripts/check-links.mjs |
Removed redirect validation logic from link checker |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request simplifies the Next.js build process by enforcing static exports, removing conditional logic for STATIC_EXPORT environment variables, and eliminating the redirects.json file along with its processing in next.config.mjs and the check-links.mjs script. The package.json scripts are updated to reflect these changes, including using the serve package to serve the static output, and yarn.lock is updated for the new dependencies. A review comment suggests optimizing the start script by directly calling serve out instead of npx serve out.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This pull request makes significant changes to the documentation site's build, deployment, and link-checking processes. The main updates include simplifying the static export and deployment configuration, removing custom redirect handling, and updating scripts and dependencies to support these changes.
Build and Deployment Process Improvements:
.github/workflows/deploy.yml) to automate deploying the static documentation site to GitHub Pages using Nextra, including steps for building, generating assets, and deploying to a custom domain.next.config.mjsby always settingoutput: 'export'and removing conditional/static export logic and custom redirect handling. [1] [2]package.jsonto reflect the new static export process and use theservepackage for local serving. [1] [2]yarn buildcommand instead of a custom static build script.Redirect and Link Checking Changes:
redirects.jsonfile and all related logic for handling custom redirects in both the Next.js config and thescripts/check-links.mjslink checker. The link checker now only validates routes and no longer considers redirects. [1] [2] [3] [4] [5] [6] [7]Dependency Cleanup:
fsandpath) fromnext.config.mjsthat were previously used for redirect handling.These changes streamline the deployment workflow, ensure a consistent static export, and remove custom redirect logic in favor of a simpler, more maintainable setup.