GitHub Pages allows you to host a website from your repository. In this task, we will deploy our WakeUpTimes app as a GitHub Page.
.nojekyll
file to the repositoryBy default, GitHub Pages uses a static site builder called Jekyll. However, we do not need Jekyll as we have already built our website! To inform GitHub of this, we need to add a .nojekyll
file to our repository.
To do so, go to your local repository (the wakeuptimes-app
folder on your computer) and add the file .nojekyll
. The file should have a leading dot in its name and no content (it should be empty). Once you’ve created the file, commit the changes using the following commands:
Note that although the changes are committed in your local repository, the remote repository on GitHub is still behind your local repository.
git push
To sync the local and remote repositories, you need to push the latest local commits to the remote repository. You can accomplish this by running the following command:
Once this is complete, go to your repository page on GitHub. You should now see a .nojekyll
file in the repository.
Firstly, navigate to the “settings” tab in your GitHub repository. Then, locate the “GitHub Pages” section and set its source to the “main” branch, as shown in the image below.
After saving the changes, GitHub will begin building the page for your app. You can view this action in the Actions tab.
Once the action is complete (indicated by a green checkmark), go back to the Settings tab and navigate to the Pages section. The URL for your deployed application will be displayed.
Click on the link to view your app, which should now be deployed and available on the internet!