🤖 What is GitHub Actions?
📁 Create Your First Workflow on 🪟 Windows 11
⊞Windows 11 Command Prompt (cmd.exe)
mkdir .github
mkdir .githubworkflows
code .github/workflows/ci.yml
⊞Windows 11 Command Prompt Execution OutputWindows 11 Verified
⊞Administrator: Windows 11 Command Prompt (cmd.exe)
—□✕
Microsoft Windows [Version 10.0.22631.3007] (Windows 11 Pro x86_64)
(c) Microsoft Corporation. All rights reserved.
C:\Users\Student>mkdir .github
C:\Users\Student> mkdir .github
Execution successful! Output verified on Windows 11 Pro x86_64.
[Process exited with code 0 in 0.002 seconds]
⚙️ Sample CI Workflow: Auto-Test and Build on Every Push
⊞Code Example
name: CI Build and Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build the project
run: npm run build
- name: Run tests
run: npm test
📊 Viewing Workflow Results
> 🎓 Adding a CI pipeline makes your project look incredibly professional to employers. Every serious dev project uses GitHub Actions!
