DEPLOYING Web map To GitHub pages
This is a continuation of our learning on using QGIS2Web plugin in publishing maps for the web [https://gisproblems.tumblr.com/post/172289905841/publishing-maps-to-web-using-qgis]. We would be taking our maps from our local/private web browsers to make them available to everyone on the internet.
Register for a github account at https://github.com
While selecting your username, make sure it is one you would like to see as your github page url. An example is https://bayoishola20.github.io || https://your-username.github.io
2. Log in to the new account. Pay attention that I logging in with my username.
3. Create a new repository. Navigate to this url to create a github repository. https://github.com/new Ensure you are logged in.
4. Â We would go ahead to fill the necessary information from the previous step.
Insert âRepository nameâ as your-username.github.io .In my case, it is bayoishola20.github.io. Leave it as Public so that everyone can see it. Also do not check âInitialize this repository with a READMEâ. Finally, hit the green âCreate repositoryâ button.
5. A redirect should occur after completing the last step. At this point all is set-up and we would need to head to our computer and push the code site we built.
If you navigate to the page (https://your-username.github.io ), you should see the below. This is because we are yet to take our files online.
6. If you do not have git installed on your system, follow the below guidelines. [If you are on Ubuntu Linux OS, skip this as you should already have git installed.]
Download Git bash for Windows/Mac here https://git-scm.com/downloads .
During the installation process, use the default options provided except you are well familiar with the alternatives.
After installation, your screen should look like below (for Windows).
Run the below commands one-after-the-other in the bash window to set-up our configuration. git config --global user.name "your-username" git config --global user.email "[email protected]"
Replace your-username with your github username and [email protected] with the email you used in creating your account.
¡     To confirm all you have done, enter the following in your bash window
     git config âlist
7. Navigate to the folder where you have the web map app you need to deploy.
For instance, to navigate to the desktop folder, you would do:
   cd ~/Desktop
Be careful to note that a forward slash and not backslash is used.
Recall that in the previous tutorial that you could specify the folder you want your web map to be saved. (See below screenshot)
At the bottom of the list result, should see user.name and user.email and its values somewhere below.
By default, the exported folder has a very long name. Rename it to âqgis2webâ.
8. Â Now, head back to the repository we created on github and copy url.
Enter the below and the link you copied in your git bash. It should take this format.
 git clone https://github.com/yourusername/your-username.github.io.git
You may now change directory by moving into the new folder you just cloned. The folder should look my screenshot above.
cd your-username.github.io
When done, go back to the repository and you should put all the qgis2web folder map app files there.
If you look into the qgis2web folder, you will see an index.html. This file must always be present in order to get the url working correctly.
In the CSS folder, you would see a file called âqgis2webâ. It is a CSS file. Open it with Notepad or any editor of your choice and copy-paste the below to the top of the file.
html, body, #map {
 width: 100%;
 height: 100%;
 padding: 0;
 margin: 0;
}
Once in the your-username.github.io folder that you just cloned, run the below commands one-after-the-other in your git bash window.
git init
git commit -m "first commit"
git remote add origin https://github.com/your-username/your-username.github.io.git
git push -u origin master
When you run the last command, you would need to enter both username and password you created on your github account (Did you forget it? Perform a password reset on the github.com and you should try not to forget it.)
Once done, go back to your github repository and you would see all the files you just pushed.
Now navigate to https://your-username.github.io/qgis2web and your site should be up and running.










