Skip to content

build(Hosting): Migrate from Netlify to GitHub Pages - #981

Merged
markhigham merged 1 commit into
masterfrom
deploy-storybook-master-gh-pages
Feb 13, 2026
Merged

build(Hosting): Migrate from Netlify to GitHub Pages#981
markhigham merged 1 commit into
masterfrom
deploy-storybook-master-gh-pages

Conversation

@markhigham

Copy link
Copy Markdown
Collaborator
  • Add GitHub Pages deployment workflow with manual trigger support
  • Add CNAME for custom domain (docs.design-system.navy.digital.mod.uk)
  • Add static export script to package.json
  • Configure Next.js with unoptimized images for static export
  • Remove Netlify configuration and branch deploy preview workflow

@markhigham
markhigham requested a review from m7kvqbe1 as a code owner February 9, 2026 16:53
@markhigham
markhigham force-pushed the deploy-storybook-master-gh-pages branch from f98a112 to 322c4a4 Compare February 9, 2026 17:10
@markhigham
markhigham force-pushed the deploy-storybook-master-gh-pages branch from 8e67c9f to 2d0b860 Compare February 9, 2026 17:22

@m7kvqbe1 m7kvqbe1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good - just a few comments.

I see it has run as part of the branch - is there a URL we can use to access it somewhere, I can't find it?

Comment thread next.config.js

module.exports = withTM({
images: {
unoptimized: true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need this we didn't do this before?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

unoptimized: true is required because GitHub Pages doesn’t support Next’s image optimizer

Comment thread public/CNAME
@@ -0,0 +1 @@
docs.design-system.navy.digital.mod.uk

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this for GitHub pages configuration then?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

apparently so but there's also an option in the web ui

Comment thread package.json
Comment on lines 8 to +9
"build": "next build",
"export": "next build && next export",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does next export do that next build didn't?

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: SonarCloud Scan

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How come we need to turn this off?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Broken - we probably need a new token

- Add GitHub Pages deployment workflow with manual trigger support
- Add CNAME for custom domain (docs.design-system.navy.digital.mod.uk)
- Add static export script to package.json
- Configure Next.js with unoptimized images for static export
- Remove Netlify configuration and branch deploy preview workflow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@markhigham
markhigham force-pushed the deploy-storybook-master-gh-pages branch from 2d0b860 to 219073c Compare February 13, 2026 13:28
@markhigham
markhigham merged commit 82e4f7b into master Feb 13, 2026
5 checks passed
@markhigham
markhigham deleted the deploy-storybook-master-gh-pages branch February 13, 2026 15:20
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