🚀 Git Repository & CI Pipeline Setup Guide
📁 Step 1: Create Your Git Repository
1
Create a new folder for your project
mkdir my-project
cd my-project
2
Initialize Git repository
git init
What this does: Creates a new Git repository in your current folder. This creates a hidden .git folder that tracks all your changes.
3
Create your first file
echo "# My Project" > README.md
4
Add and commit your files
git add .
git commit -m "First commit"
⚙️ Step 2: Create GitHub Actions Pipeline
1
Create the GitHub Actions folder structure
mkdir -p .github/workflows
📁 your-project/
├── 📁 .github/
│ └── 📁 workflows/
│ └── 📄 ci.yml
└── 📄 README.md
2
Create the pipeline file
touch .github/workflows/ci.yml
Copy and paste this YAML configuration into the ci.yml file:
name: Simple CI
on:
push: # ירוץ על כל Push
branches: ["**"]
jobs:
run-simple-task:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Say hello
run: echo "שלום GitHub Actions! בוצע Push 🚀"
📋 Understanding the Pipeline Configuration
🔧 Configuration Breakdown:
- name: The name of your pipeline
- on: push: Triggers the pipeline on every push
- branches: ["**"] Runs on all branches
- runs-on: ubuntu-latest Uses Ubuntu server
- actions/checkout@v4 Downloads your code
- run: echo Executes the hello message
🌐 Step 3: Push to GitHub
1
Add your pipeline files
git add .github/workflows/ci.yml
git commit -m "Add CI pipeline"
2
Connect to GitHub repository
git remote add origin https://github.com/yourusername/your-repo.git
git branch -M main
git push -u origin main
Note: Replace "yourusername" and "your-repo" with your actual GitHub username and repository name.
✅ Step 4: Verify Your Pipeline
1
Check GitHub Actions tab
Go to your GitHub repository and click on the "Actions" tab to see your pipeline running.
2
View the results
You should see your pipeline with the message: "שלום GitHub Actions! בוצע Push 🚀"
🎉 Congratulations! You have successfully created a Git repository with a working CI pipeline. Every time you push code to GitHub, your pipeline will automatically run and display the hello message.