Signed in as
Today, you're DevOps: help students get their sites pushed to production using GitHub Pages.
This is a big day for students! They're publishing their sites for the first time. Help them keep the momentum going as we dive into the more difficult concepts going forward.
There's really no intro activity for this lesson. If anything, today should be a 🎉__PARTY__ 🎉 in class! Why? We're publishing our pages! Help students walk through creating a repository, uploading the content, and serving their site via GitHub Pages.
Take the formative assessment at the end of class. Work towards mastery.
Party! Looking for something more productive? Party while each person presents their site to the class!
By the end of this lesson, you'll have deployed your first production website to the internet! You already have an account with Github and we'll be using their service for hosting static sites called Github pages. We won't go too deep into what git, a version control system, is, but it's important to know that it's widely used by developers. The purpose of a version control system like git is so that many developers can work on a project, simultaneously, and collaborate as they iteratively work their way through building features and fixing bugs. Eventually, you and a team of your classmates will work together using git to collectively build a client project.
If you're still working on your site and aren't ready for it to be live, hold off! You can always come back to this when the time comes. We're going to look at two methods of getting our project online. The first will be to use your command line (PowerShell on Windows and Terminal on MacOS) and the second will be using your browser to drag/drop and upload files. People with more experience generally enjoy the expediency of working via the command line, but both choices will get you to the same result.
Regardless of which choice you make, we're going to start in the same place: on Github.
At this point, if you plan on using git via the command line, pick up with these directions. Otherwise, head down to the 'File Upload' heading below.
NB: The following assumes you have git installed on your machine. You can download it from here if needed.
This will make an initial commit, or addition of your code to the repository. However, it won't actually add any files. We have another few steps to go.
1# This will add all the files in the current directory (your project) 2git add . 3# This will create a message to go with your commit 4git commit -m "My first REAL commit of files" 5# This will push your code to your repo on Github 6git push origin main
At this point, you should be able to navigate to your repo using your browser and see your project's code online. If you can, head down to the heading of 'Github Pages' below.
Github pages is an excellent static method for hosting projects like these!