![]() ![]() ![]() Setting up your GitHub Pages environmentĮnough talk, let's get our hands dirty and set up our GitHub Pages environment with all the automation you need to quickly deploy new changes to your website. With GitHub Pages, you could accomplish this by using GitHub Actions, but we'll keep this tutorial simple and not go over that. Normally you only have your source files in Git, because the CI/CD pipelines build the production files for you. When the files have been served, it's possible to retrieve data from any external service you have at your disposal.Īnother thing that seems a little backward, if you've worked with CI/CD systems before, is that all of your production files will need to be in Git. JavaScript files are static files, so the server will be able to serve those as they are. If you want to have a dynamic website, you can still do this, but you'll need to do it through JavaScript. There is no scripting layer and you can't execute PHP files for example. A web server like Nginx is serving the files as-is. GitHub Pages is essentially a service that gives you a folder on a server. Your repository is the source of truth, so your compiled JS / CSS files need to be in Git.You can only host static websites (or dynamic through static JS files).Hosting on GitHub Pages is great, but there are some limitations and gotchas. What are the limitations of hosting on GitHub Pages? This is what this tutorial will focus on. This is a slightly more involved solution but is much cleaner than the second option. This is where the third option comes in: using your master branch for all your source files and having a separate "gh-pages" branch that holds the production files for your website. This is the easiest solution for hosting your website on GitHub Pages, but it's not the cleanest option. For example, you'd be able to see the contents of your SCSS files by going to. What this means is that all of your source files, including build scripts, package.json file, and other "source" files like SCSS are accessible through the internet. The second option is to use the master branch both as the source of your website and the production website itself. In this tutorial, we'll focus on deploying a plain HTML / CSS / JavaScript website. Jekyll is supported by GitHub, which means GitHub will do everything needed to deploy a Jekyll website for you. In this post, I will not be going over how to use Jekyll in combination with GitHub pages. Using your master branch as your source and gh-pages as your production website.Using your master branch as your source and production website. ![]() There are a few options you have for hosting your website on GitHub Pages, these include: What are my options for hosting a static website? ![]() Before we get into the steps you have to take to publish your website to GitHub Pages, I will outline a few options and limitations you have when using GitHub Pages for your website hosting. After this tutorial, you will be able to automatically deploy your own website to the internet. So you want to host your static website on GitHub Pages? Excellent choice! In this tutorial, I'm taking you through the steps to host your static website on GitHub Pages and how you can deploy your own changes. Tutorial: How to set up and automatically deploy your website to GitHub Pages Home Blog Tutorial: How to set up and automatically deploy your website to GitHub Pages ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |