Skip to content

Latest commit

 

History

History
611 lines (446 loc) · 19.9 KB

File metadata and controls

611 lines (446 loc) · 19.9 KB

🚀 GitHub Actions Learning Repository

Welcome to your hands-on learning journey with GitHub Actions! This repository is designed for beginners and intermediate developers who want to master CI/CD automation.

GitHub for Beginners banner

Follow me on GitHub Star this repo

📚 What You'll Learn

  • ✅ GitHub Actions fundamentals (workflows, jobs, steps)
  • ✅ Automating builds and tests
  • ✅ CI/CD pipeline creation
  • ✅ Deploying applications to Azure App Service
  • ✅ Working with secrets and environment variables
  • ✅ Real-world workflow examples

🎯 Target Audience

  • Beginners to CI/CD
  • Developers wanting to automate their workflows
  • Students learning DevOps practices
  • Anyone interested in GitHub Actions

📋 Prerequisites & Setup

Requirements

  • A GitHub account
  • Git installed locally
  • Node.js v16+ installed
  • (Optional) Azure account for deployment tasks

Quick Setup (5 minutes)

  1. Fork this repository

    # Click "Fork" button on GitHub
  2. Clone your fork

    git clone https://github.com/YOUR-USERNAME/github-actions-learning.git
    cd github-actions-learning
  3. Install dependencies for sample app

    cd sample-app
    npm install
    npm start

    Visit http://localhost:3000 - you should see the welcome page!

  4. Run tests locally

    npm test

    All tests should pass ✅


📚 Learning Content & Documentation

1️⃣ Start Here: Quick Start (5 minutes)

Getting started immediately:

  • Fork the repository
  • Clone: git clone https://github.com/YOUR-USERNAME/github-actions-learning.git
  • Install: cd sample-app && npm install
  • Run: npm start (visit http://localhost:3000)
  • Test: npm test

2️⃣ Read Documentation (45-60 minutes)

Go through these in order in the docs/ folder:

  1. 01-what-is-github-actions.md - Concepts & basics (10 min)
  2. 02-workflow-basics.md - YAML syntax & structure (15 min)
  3. 03-triggers-and-events.md - When workflows run (10 min)
  4. 04-jobs-and-steps.md - Execution model (15 min)
  5. 05-secrets-and-env.md - Security & configuration (10 min)
  6. 06-build-and-test.md - CI/CD patterns (15 min)
  7. 07-deploy-to-azure.md - Cloud deployment (10 min)

3️⃣ Complete All Tasks (2-4 hours)

Follow TASKS.md for 10+ hands-on exercises organized by difficulty:

Level Tasks Time Skills
🌟 Beginner 1-3 30 min Fundamentals & basics
⭐⭐ Intermediate 4-7 1-2 hours Workflow creation & automation
⭐⭐⭐ Advanced 8-10 2-3 hours Production-ready patterns

4️⃣ Example Workflows

Three production-ready workflows to learn from:


🏅 Earn Digital Badges

Complete tasks at each level and submit your work to earn prestigious badges!

🌟 Beginner Badge

Complete Tasks 1-3

Steps:

  1. Complete all Beginner tasks in TASKS.md
  2. Take screenshots of successful workflow runs
  3. Fork the repo → Create branch working-beginner-yourname
  4. Create file .github/submissions/beginner-yourname.md with evidence
  5. Commit → Push → Create Pull Request
  6. Submit link via 🎖️ Badge Submission issue (select "Beginner")
  7. Automatic labels applied: submission, beginner, pending-review
  8. Auto-assigned to reviewer for approval

Proof needed:

  • Task 1: Hello World workflow running ✅
  • Task 2: Workflow triggered by push event ✅
  • Task 3: Local tests passing with npm test ✅

⭐⭐ Intermediate Badge

Complete Tasks 4-7

Steps:

  1. Complete all Intermediate tasks in TASKS.md
  2. Gather workflow execution screenshots and logs
  3. Fork the repo → Create branch working-intermediate-yourname
  4. Create file .github/submissions/intermediate-yourname.md with evidence
  5. Commit → Push → Create Pull Request
  6. Submit link via 🎖️ Badge Submission issue (select "Intermediate")
  7. Automatic labels applied: submission, intermediate, pending-review
  8. Auto-assigned to reviewer for approval

Proof needed:

  • Task 4: Custom workflow running on develop branch ✅
  • Task 5: Environment variables displaying in logs ✅
  • Task 6: GitHub secrets access (masked in logs) ✅
  • Task 7: Matrix testing across 3 Node versions in parallel ✅

⭐⭐⭐ Advanced Badge

Complete Tasks 8-10

Steps:

  1. Complete all Advanced tasks in TASKS.md
  2. Gather comprehensive screenshots and workflow logs
  3. Fork the repo → Create branch working-advanced-yourname
  4. Create file .github/submissions/advanced-yourname.md with evidence
  5. Commit → Push → Create Pull Request
  6. Submit link via 🎖️ Badge Submission issue (select "Advanced")
  7. Automatic labels applied: submission, advanced, pending-review
  8. Auto-assigned to reviewer for approval

Proof needed:

  • Task 8: Artifacts uploaded & downloaded between jobs ✅
  • Task 9: Conditional execution (deploy on main only) ✅
  • Task 10: PR created with template & issue using template ✅

🎯 Submission Process Simplified

One Simple Way to Submit

  1. Fork the repo (click Fork button)

  2. Clone your fork

    git clone https://github.com/YOUR-USERNAME/github-actions-learning.git
    cd github-actions-learning
  3. Create working branch (use this naming: working-<level>-<yourname>)

    git checkout -b working-beginner-john
  4. Complete your tasks from TASKS.md and gather evidence (screenshots)

  5. Create submission file in .github/submissions/

    # Create this folder if it doesn't exist
    mkdir -p .github/submissions
    
    # Create file: beginner-john.md (for Beginner)
    # or: intermediate-john.md (for Intermediate)
    # or: advanced-john.md (for Advanced)
  6. Add evidence to your file (screenshots, workflow links, etc.)

  7. Commit your changes

    git add .github/submissions/beginner-john.md
    git commit -m "feat: add beginner badge submission"
    git push origin working-beginner-john
  8. Create Pull Request on GitHub with your branch

  9. Submit Tracking Issue via 🎖️ Badge Submission

    • Select your level (Beginner/Intermediate/Advanced)
    • Paste your PR link
    • Labels & assignment happen automatically!

That's it! 🎉 Automatic labels and assignment handle the rest.


✅ What Happens After Submission

Step Automatic Manual
Level Selection N/A You choose in issue
Labels Added ✅ Auto (submission + level) N/A
Assignment ✅ Auto (@nisalgunawardhana) N/A
Review Manual (2-5 days) Reviewer checks evidence
Feedback Comments on PR If revisions needed
Approval Issue closed Badge awarded! 🏅

📋 Submission File Template

Create a simple markdown file with your evidence:

# Beginner Badge Submission - Your Name

**Date:** January 2026
**Status:** Submitted for Review

## Tasks Completed

- [x] Task 1: Run Your First Workflow
- [x] Task 2: Understand Workflow Triggers
- [x] Task 3: Build and Test Locally

## Evidence

### Task 1: Hello World Workflow
[Screenshot showing successful workflow run]

### Task 2: Push Trigger
[Screenshot showing workflow triggered automatically on push]

### Task 3: Local Tests
[Screenshot showing npm test output - all passing]

## Notes
Any challenges faced or additional context.

---

Submitted & ready for review! ✅

That's all you need! No complex templates, just clear evidence.


🗂️ Repository Structure

github-actions-learning/
├── README.md                          # Main guide (this file)
├── TASKS.md                           # All learning tasks (10+)
├── CONTRIBUTING.md                    # How to contribute
├── LICENSE                            # MIT License
│
├── docs/                              # Learning documentation
│   ├── 01-what-is-github-actions.md
│   ├── 02-workflow-basics.md
│   ├── 03-triggers-and-events.md
│   ├── 04-jobs-and-steps.md
│   ├── 05-secrets-and-env.md
│   ├── 06-build-and-test.md
│   └── 07-deploy-to-azure.md
│
├── images/                            # Digital badges
│   ├── Beginner.png
│   ├── Intermediate.png
│   └── Advanced.png
│
├── .github/
│   ├── workflows/                     # Example workflows
│   │   ├── hello-world.yml
│   │   ├── build-test.yml
│   │   └── deploy-azure-app-service.yml
│   ├── submissions/                   # Your badge submissions go here
│   ├── ISSUE_TEMPLATE/
│   │   ├── badge_submission.md        # 🎖️ Submit badge (auto-labels & assigns!)
│   │   ├── bug_report.md              # Report bugs
│   │   ├── feature_request.md         # Suggest improvements
│   │   ├── documentation.md           # Improve docs
│   │   └── question.md                # Ask questions
│   └── PULL_REQUEST_TEMPLATE.md       # PR template
│
└── sample-app/                        # Sample Node.js app
    ├── src/server.js
    ├── tests/server.test.js
    ├── package.json
    └── README.md

🔄 Learning & Development Workflow

For Self-Paced Learning

  1. Preparation (5 min)

    • Fork repository
    • Clone to your machine
    • Setup sample app
  2. Study (45-60 min)

    • Read documentation in docs/ folder
    • Understand concepts
    • Review example workflows
  3. Practice (2-4 hours)

    • Complete TASKS.md exercises
    • Run workflows
    • Modify and experiment
  4. Submit (10 min)

    • Create submission file with evidence
    • Push to GitHub
    • Create PR and submit tracking issue
    • Auto-labels and auto-assigns!
  5. Review (2-5 days)

    • Reviewer checks your work
    • Feedback if needed
    • Badge awarded! 🏅

For Team/Classroom Use

  1. Setup

    • Clone this repository to your organization
    • Share link with team/students
  2. Students Fork & Learn

    • Each student forks the repo
    • Creates working-* branch
    • Completes tasks locally
  3. Submit via PR

    • Creates submission file
    • Opens PR on main repo
    • Submits tracking issue with level selection
  4. Auto-Organization

    • Labels apply automatically (submission, beginner/intermediate/advanced)
    • Assignment automatic
    • Reviewers can focus on quality
  5. Feedback & Approval

    • Reviewer provides feedback
    • Student makes revisions if needed
    • Badge awarded on approval

🎓 Complete Task List

🌟 Beginner Tasks (30 min total)

# Task Time What You Learn
1 Run Your First Workflow 5 min Trigger workflows manually, read logs
2 Understand Workflow Triggers 10 min Automatic triggers on push
3 Build and Test Locally 15 min Run app & tests locally

Submit: 🎖️ Beginner Badge Issue → Select "Beginner" → Auto-labels & assigns!


⭐⭐ Intermediate Tasks (1-2 hours total)

# Task Time What You Learn
4 Create a Custom Workflow 15 min Build workflows from scratch
5 Add Environment Variables 10 min Configure with env vars
6 Use GitHub Secrets 10 min Handle sensitive data securely
7 Matrix Testing 15 min Test multiple Node versions

Submit: 🎖️ Intermediate Badge Issue → Select "Intermediate" → Auto-labels & assigns!


⭐⭐⭐ Advanced Tasks (2-3 hours total)

# Task Time What You Learn
8 Upload and Download Artifacts 20 min Share data between jobs
9 Conditional Execution 15 min Run steps conditionally
10 Create a PR and Use Issue Templates 20 min Contribute to projects

Submit: 🎖️ Advanced Badge Issue → Select "Advanced" → Auto-labels & assigns!


🏆 Bonus Challenges


🔧 Example Workflows Explained

1. Hello World Workflow

File: .github/workflows/hello-world.yml

name: Hello World
on: push
jobs:
  hello:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Hello, GitHub Actions!"

Learn: Basic workflow structure, triggers, steps
Related Tasks: Task 1, Task 2


2. Build & Test Workflow

File: .github/workflows/build-test.yml

Uses matrix testing across Node versions, installs dependencies, runs tests.

Learn: Matrix strategies, dependencies, caching
Related Tasks: Task 3, Task 7


3. Deploy to Azure Workflow

File: .github/workflows/deploy-azure-app-service.yml

Builds and deploys app to Azure App Service.

Learn: Production deployment, secrets, conditional execution
Related Tasks: Task 6, Challenge 1


📚 Documentation Overview

Doc Topics Duration Level
01-what-is-github-actions.md What & why GitHub Actions 10 min Beginner
02-workflow-basics.md Workflow structure & YAML 15 min Beginner
03-triggers-and-events.md When workflows run 10 min Beginner
04-jobs-and-steps.md Jobs, steps, runners 15 min Intermediate
05-secrets-and-env.md Configuration & security 10 min Intermediate
06-build-and-test.md CI/CD pipelines 15 min Intermediate
07-deploy-to-azure.md Azure deployment 10 min Advanced

Total Learning Time: ~1.5 hours of documentation
Total Task Time: 3-6 hours of hands-on practice


💡 Tips for Success

Learning Tips

  1. Start sequentially - Don't skip around
  2. Read the docs first - Foundation matters
  3. Run the examples - See it in action
  4. Modify workflows - Experiment & break things
  5. Read the logs - GitHub Actions logs tell you everything
  6. Add comments - Document what you learn

Task Completion Tips

  1. Screenshot everything - For badge submission
  2. Take your time - Quality > Speed
  3. Experiment with modifications - "What if I..."
  4. Get stuck? - Create a Question issue
  5. Found a problem? - Report Bug report

Submission Tips

  1. Create clear submission files - Organize evidence well
  2. Use descriptive commit messages - Help reviewers understand
  3. Follow branch naming - working-level-yourname
  4. Set level in issue - Triggers auto-labels
  5. Link your PR - Include it in submission issue

🤝 How to Contribute

If you find issues or have improvements:

  1. Report Issues

  2. Contribute Code

  3. Share Knowledge

    • Improve documentation
    • Create clearer examples
    • Help others in issues

📞 Support & Questions

Getting Help

  1. Check Documentation - Start with docs/ folder
  2. Review Examples - Look at workflows in .github/workflows/
  3. Check TASKS.md - Find similar examples
  4. Create Issue - Use question.md template
  5. Contact Maintainer - @nisalgunawardhana

Common Issues

Q: My workflow isn't running?
A: Check the trigger event. See 03-triggers-and-events.md

Q: How do I use secrets safely?
A: See 05-secrets-and-env.md

Q: How do I deploy to Azure?
A: See 07-deploy-to-azure.md and Challenge 1


🎖️ Badge Submission Tracking

Submission Flow

Start → Learn → Complete Tasks → Create Branch → Submit File 
  → Push PR → Submit Issue → Auto-Labels & Assign → Review → Badge! 🏅

Automatic Workflow

  1. You choose level in badge submission issue
  2. System auto-adds labels - submission, beginner/intermediate/advanced
  3. System auto-assigns - @nisalgunawardhana
  4. Reviewer reviews - 2-5 days
  5. Feedback or approval - You're notified
  6. Badge awarded! - Congratulations! 🎉

No Manual Labeling Needed! ✨

Just select your level in the issue → Everything else is automatic!


📊 Repository Statistics

  • 📚 7 Learning Modules in docs/
  • 🔧 3 Example Workflows ready to use
  • 📝 10+ Hands-On Tasks organized by level
  • 💻 Sample Node.js App with tests
  • 📄 Multiple Issue Templates for contributions
  • 🎖️ Badge System with auto-organization

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


⭐ Show Your Support

  • ⭐ Star this repository
  • 🔀 Share with friends/colleagues
  • 📢 Tell others about it
  • 🤝 Contribute improvements
  • 💬 Provide feedback

Ready to get started? Begin with setup above or jump to TASKS.md! 🚀

Questions? Create an ❓ Question Issue

Happy Learning! 🎓