Skip to content

Deploying to GitHub Pages

Eric Nguyen edited this page May 26, 2024 · 4 revisions

Build the web app:

flutter build web

From the master branch, create a new gh-pages orphan branch:

git checkout --orphan gh-pages

Unstage all changes:

git reset

Add the build/web directory:

git add build/web --force

Remove all the .DS_Store files from the staged changes and edit the index.html file so that it has <base href="/ateez_lyrics/" /> and then commit the changes:

git commit -m "Initial commit"

Note: The Conventional Commits Git Hook may affect Git commits from working. To disable, comment out the code in the main function in tools/git_hooks.dart.

(Optional) Rebase to origin/gh-pages:

git rebase origin/gh-pages

Push the changes:

git subtree push --prefix build/web origin gh-pages

If you need to force push then try:

git push origin `git subtree split --prefix build/web gh-pages`:gh-pages --force 

Reference:

Clone this wiki locally