Setting Up Your Project
00:00 To work with GitHub Actions, you need a Git repository. More specifically, a remote repository and a local repository. And in this lesson, you will set everything up and check if it works.
00:11 You will create your remote repository first, then clone the remote repository, change the README markdown file locally, and then commit and push the changes to see if everything works.
00:24
To get started, you need your browser and the terminal. On the left side, you can see my browser, where I’m already at github.com/new
, which is a shortcut to create a new repository.
00:34 And on the right side, you see my terminal. In the terminal, I will clone the remote repository in a moment, but in order to clone it, let’s create it first.
00:43 If you want to follow along closely with this course, I recommend to use the same settings as I do because this will make following along way more convenient for you.
00:52
The name of the repository is hello-github-actions
.
01:02 If you want, you can add a description. I’ll skip this. I set the repository to private so I can play around with nobody seeing. I want to add a README file so that there is something in the repository already.
01:17
And as the .gitignore
template, it’s a good idea to use the Python .gitignore
file, no license, and create the repository.
01:29
Once the repository is created, click on the green code button and copy the remote repository URL. Now in the terminal, create your project folder. I’m using hello-gh
for GitHub, and then -actions
. Navigate into the folder,
01:50
and then clone the repository. Make sure to add a dot after your git clone
command, because that way you ensure that the Git repository is cloned into the current folder.
02:02 Or if you don’t care about a special folder name, you can skip the folder creation and just clone the repository without a dot, and then the repository name will be the folder name.
02:14
Next, let’s make a round trip to check if you can also push to the remote repository. To do so, make a change to the README file. Since we are in terminal already, let’s use the terminal and type echo
, and then in quotes n
because you want to add a newline first, This repo is my playground for GitHub Actions.
And then two greater signs >> README.md
.
02:43
The echo
command takes a text inside the quotes and prepares it to be displayed or used, but instead of displaying it to the terminal, you use the append operator, that’s the two greater signs, to add the text to the end of the README file.
02:57
Don’t forget the n
at the beginning of your string to add the description on a newline in the README file. Now, if you have a look at the state of the repo, you see that the README file was successfully modified.
03:10 That means you can stage it, create a commit, and then push it to the remote Git repo.
03:25 Head over to the browser and reload your remote repository. There, you can see that the changes are in the README file. That means pushing to your remote GitHub repo works as it should, and that means you can get started with creating your first GitHub Action in the next lesson.
Become a Member to join the conversation.