tooty icon indicating copy to clipboard operation
tooty copied to clipboard

bug: Fixes for `npm run deploy`

Open pnwmatt opened this issue 10 months ago • 0 comments

Hiya,

In my attempt to fix a bug, I discovered that the deploy steps implemented in npm run deploy were in a confused state.

Steps to reproduce:

In a fresh fork of tooty, run npm run deploy. You'll see the readme.md as index.html, which is confusing because the documentation says you should see the Elm app. It was actually deployed to /tooty/v2.

The readme.md was converted to index.html by Github now running jekyll build on all projects - even though this isn't a jekyll project.

Therefore, I made some changes:

1. Deploy to repo root directory instead of /tooty/v2

The Readme.md says the deployed URL will be:

https://[your-github-username].github.io/tooty/

but the actual deploy was going to /tooty/v2. This is particularly confusing because Github was converting readme.md to index.html when trying to build the project with Jekyll.

Recommendation: Deleting your gh-pages branch one time will remove the confusing state of your branch (with content in both /(root) and /v2)

Actions Taken: Added /v2 to the gh-pages dist parameter.

2. gh-pages branch was mixing deploy/v2 and /(root)

gh-pages's --add flag moves the content from --dist to the root of the project, but we actually should just replace the content at root with deploy/v2's content. Removing the --add flag stops the content from merging together.

Actions Taken: Removed --add from gh-pages

3. Github Pages defaults to doing a jekyll build

Per the Github Documentation regarding deploying github pages:

Most external CI workflows "deploy" to GitHub Pages by committing the build output to the gh-pages branch of the repository, and typically include a .nojekyll file. When this happens, the GitHub Actions workflow will detect the state that the branch does not need a build step, and will execute only the steps necessary to deploy the site to GitHub Pages servers.

Actions Taken: Added a touch build/v2/.nojekyll to the copy-assets npm command.

4. The project description links to v2

image

Recommendation: After merging, remove the v2 from the project description on github.

pnwmatt avatar Feb 07 '25 04:02 pnwmatt