Skip to content

Configuring GitHub

DanPeled edited this page Aug 27, 2024 · 5 revisions

Creating your GitHub repository

To get your project started, fork this repository by pressing the Fork button located on the top of this repository page.

Setting up GitHub Pages Hosting

In order to set up Github Pages hosting, u can deploy your HTML website from the code by either running the ./gh-deploy bash script, or deploy manually:

Bash Script Deployment

In the root folder, run the gh-deploy.sh file in order to push onto the ghpages branch in your repository. In order to make it work:

  • Your root folder will have to be linked to a git repository remote
  • Modify the gh-deploy.sh commands to either include or disclude the <base href="/"> on your code (Discluded by default)

Manual Deployment

In order to deploy to GitHub Pages, you will need to do the following steps:

  1. Run the flutter build web --web-renderer html command in the root folder of your project.
  2. In the build/web/index.html file, remove the line that says : <base href="/"> (IF YOU WONT REMOVE THIS LINE, YOUR WEBSITE WILL NOT WORK ON DEFAULT)
  3. Push the build/web dir's content into a GitHub repo / branch and enable github pages to it.

After deploying your initial website, navigate to your GitHub's repository settings, and under Pages choose

  • Deploy From a branch as the source
  • the ghpages branch as the branch to deploy from

Clone this wiki locally