Setting Up a Practice Repository
Every workflow you write from here on needs somewhere real to run. Before touching a single line of YAML, you need a repository that actually triggers GitHub Actions when you push to it — so let’s get that out of the way first so that you are fully ready for the next chapters in this section.
Create The Github Repository
Create a new public repository on GitHub called actions-practice. You know the drill: hit the “+” in the top right, name it, skip the templates, create it empty (no README needed, you’ll add your own first file).
The repository is created but not fully available as you have not committed yet. To complete the repository creation, add a starter file and commit the changes.
Add A Starter File
Add one small Python file so there’s something in the repository for later workflows to check out, install, and run. Create app.py:
def greet(name):
return f"Hello, {name}!"
if __name__ == "__main__":
print(greet("world"))Note
Knowing Python is not necessary to learn Github Actions. Choose any language you already know or Even a text file with “Hello World” will work.
Initialize locally, commit and push it:
mkdir actions-practice
cd actions-practice
git add app.py
git commit -m "Add starter script"
git remote add origin [email protected]:<your-username>/actions-practice.git
git branch -M main
git push -u origin mainThat’s the whole repository for now. You’ll add a .github/workflows/ directory to it soon — that’s where every workflow file in this section will live.
Note
Why public and not private? Two reasons. First, GitHub-hosted runners are free and unlimited on public repositories, so you won’t burn through any Actions minutes while experimenting. Second — and this one surprises people — the same runner label actually gets you more hardware on a public repo than on a private one. A public repo’s ubuntu-latest job runs on a 4 vCPU / 16 GB machine for free; on a private repo, that identical label runs on a 2 vCPU / 8 GB machine and draws down your account’s monthly Actions minutes.
If You’d Rather Use A Private Repo
Nothing in this section requires a public repository — everything will still work on a private one. Just keep two things in mind:
- Minutes aren’t free. Every job run consumes minutes from your plan’s monthly allotment (the overview of billing and minutes from earlier in this course covers how that’s tracked). Nothing you’ll build in this section comes close to those limits, but it’s worth knowing the meter is running.
- The runner is smaller. As noted above,
ubuntu-lateston a private repo gets less CPU and RAM than the same label on a public repo. It won’t affect anything you do in this section, but it’s the kind of detail that bites people when workflows get heavier later.
If your code is something you don’t want public, private is the right call — just go in knowing the runner underneath you is a bit smaller and the clock is ticking.