Collections

Workflow de publication GitHub Pages

Outils pour configurer un domaine personnalise, préparer la sortie statique et vérifier les details de lancement avant de pousser sur GitHub Pages.

Outils disponibles

Workflow de publication GitHub Pages disponibles maintenant

Ce que cette collection aide à faire

Publier avec GitHub Pages est simple une fois configuré, mais les règles de domaine, le placement du CNAME et les verifications de build peuvent causer des 404. Cette collection regroupe les outils qui comptent avant et après le push.

Ideal pour

  • Configurer un domaine personnalise sur GitHub Pages.
  • Vérifier la sortie statique avant de pousser une version.
  • Préparer CNAME, robots.txt, sitemap et favicon pour un nouveau site.

Workflow steps

  1. Set up your repository: Create or configure your GitHub repository with the correct publishing source. Choose the branch and folder that GitHub Pages will serve from, such as main /root for user sites or gh-pages /docs for project sites.
  2. Configure your custom domain: Prepare a CNAME file with your custom domain and place it in the published output root. Configure the custom domain field in your repository settings.
  3. Update DNS records: Create a CNAME record for your www subdomain pointing to your GitHub Pages URL. Configure an ALIAS, ANAME, or A record for your apex domain if you use one.
  4. Run the SEO checklist: Use the static site SEO checklist generator to review your page metadata, indexing directives, and required files before pushing.
  5. Push and wait for HTTPS: Push your changes and wait for GitHub Pages to deploy and provision an HTTPS certificate. This can take several minutes for a new custom domain.
  6. Verify the live site: Test the published URL over both HTTP and HTTPS. Check that CNAME, robots.txt, sitemap.xml, and all assets serve correctly from the published output.

Prerequisites

  • A GitHub account with a repository configured for Pages publishing.
  • A custom domain name with DNS management access through your registrar or DNS provider.
  • Static site files ready to publish, including an index.html in the output root.
  • A build system or CI workflow that generates a dist folder or output directory for publishing.

Publishing checklist

  • CNAME file exists in the published output root and contains only the custom domain name with no extra characters.
  • DNS records for the custom domain have propagated, confirmed with a DNS lookup tool.
  • Repository publishing source setting matches the branch and folder used in the build.
  • HTTPS certificate is active and the site redirects HTTP to HTTPS automatically.
  • Sitemap.xml and robots.txt exist in the published root and reference correct URLs.
  • All assets referenced in pages, such as CSS, images, and JavaScript, return 200 status and not 404.

Related collections

Configuration de site multilingüe, Kit d'outils pour blogueurs

FAQ

Questions sur workflow de publication github pages

What happens if I change my publishing source after the site is live?

Changing the publishing source can cause a temporary outage. GitHub Pages needs to redeploy from the new source, and your custom domain may lose its HTTPS certificate during the transition. Make this change during low traffic.

Can I use GitHub Pages with a static site generator?

Yes. GitHub Pages works with any static site generator. The CI workflow typically runs the build command and deploys the output. Just make sure the generated output folder matches the publishing source setting.

Do I need to add a .nojekyll file?

If your site uses files or folders starting with an underscore, GitHub Pages may skip them because Jekyll treats underscored paths as special. Add a .nojekyll file to the published output root to disable Jekyll processing.

Why does my custom domain show a certificate error?

Certificate errors usually mean DNS has not propagated, the custom domain is misconfigured in repository settings, or GitHub Pages has not finished provisioning the certificate. Check that the CNAME file matches the repository custom domain field and that DNS points to the correct GitHub Pages IP addresses.