Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Fixes for npm run deploy #283

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

pnwmatt
Copy link

@pnwmatt pnwmatt commented Feb 7, 2025

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 pnwmatt changed the title Fixes for npm run deploy bug: Fixes for npm run deploy Feb 7, 2025
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.

1 participant