AI Hints
CI/CD with GitHub Actions · Lesson 17 of 138

The Workflows Folder

.github/workflows.

⏱ 2 min read▶ Video at 19:24🎓 Free
Watch this lesson in the CI/CD with GitHub Actions courseWatch on YouTube ↗Full CI/CD with GitHub Actions course

GitHub only looks for workflows in one place. A folder called dot github, with a folder called workflows inside it. Any YAML file there is a workflow. Put it anywhere else, and nothing happens.

The Workflows Folder
From the video: The Workflows Folder
  • One special place
  • dot github slash workflows
  • Anywhere else is ignored

Adding the folder

Mkdir dash P creates both folders at once. We copy the workflow file there, and LS shows it in its new home. Then we commit it, like any other file. The workflow is now part of the project's history. On GitHub, the push itself would start it running.

Terminal
mkdir -p .github/workflows
cp ~/hello.yml .github/workflows/
ls .github/workflows
hello.yml
git add .github && git commit -qm "Add hello workflow" && git log --oneline
126be81 Add hello workflow
7418016 First version of the shop

Naming and organising

You can have as many workflows as you like, one file each. Give the files clear names, like c i dot y m l for tests, and release dot y m l for releases. Both dot y m l and dot y a m l work. Each workflow runs independently, and shows up separately on GitHub's Actions tab.

keyvalue
.github/workflows/the only place
ci.ymltests on every push
release.ymlpublishing
One fileone workflow

Summary

Workflows live in dot github slash workflows, one YAML file each, committed like normal code. Next, how to read any workflow file.

Key takeaways
  • .github/workflows/
  • Commit them
  • One file per workflow
Next up: Reading a Workflow — top to bottom