Skip to content

ci: publish CNAME on every GitHub Pages deploy#1

Merged
prasenjit-net merged 2 commits intomainfrom
copilot/update-pages-deploy-workflow
Mar 4, 2026
Merged

ci: publish CNAME on every GitHub Pages deploy#1
prasenjit-net merged 2 commits intomainfrom
copilot/update-pages-deploy-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

GitHub Pages loses the custom domain (graphr.prasenjit.net) on each deploy because no CNAME file is included in the published artifact, requiring manual re-entry after every release.

Change

  • .github/workflows/cd-pages.yml — added the cname parameter to the peaceiris/actions-gh-pages@v4 step:
- name: Deploy to gh-pages branch
  uses: peaceiris/actions-gh-pages@v4
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./dist
    publish_branch: gh-pages
    force_orphan: true
    cname: graphr.prasenjit.net   # ← added

The action natively handles this parameter by writing a CNAME file at the root of the gh-pages branch on every push, so the custom domain persists across deployments without any manual intervention.

Original prompt

Update the GitHub Pages deploy workflow so that every build publishes a CNAME file with the custom domain.

Repo: prasenjit-net/graphr
Branch: main
Workflow file to modify: .github/workflows/cd-pages.yml

Requirements:

  • Ensure the workflow (or build step) creates a CNAME file containing exactly:
    graphr.prasenjit.net
  • The CNAME file must end up in the published Pages artifact / gh-pages content so it is not overwritten on subsequent builds.
  • Do not change the domain.
  • Keep other behavior of the workflow intact.

Deliverables:

  • A PR against main with the workflow change.
  • If needed, add or update build steps so the CNAME is generated during the build (not manually committed).

This pull request was created from Copilot chat.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: prasenjit-net <4918269+prasenjit-net@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Pages deploy workflow for CNAME file ci: publish CNAME on every GitHub Pages deploy Mar 4, 2026
@prasenjit-net prasenjit-net marked this pull request as ready for review March 4, 2026 06:36
@prasenjit-net prasenjit-net merged commit 3fb8eca into main Mar 4, 2026
1 check 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.

2 participants