- Χρήση GitHub Actions για CI/CD
- GitHub Projects για project management
- GitHub Pages για documentation
- Security features και best practices
- Advanced collaboration features
Το τελικό επίπεδο: automation με GitHub Actions (CI/CD), project management με Projects, hosting με Pages, security features (Dependabot, CodeQL), και προχωρημένα εργαλεία (CLI, API, Codespaces). Εδώ γίνεστε power users!
Προαπαιτούμενα: Αθροιστική γνώση από όλα τα προηγούμενα επίπεδα. Τα GitHub features ενσωματώνουν τα πάντα: commits, branches, remotes, PRs, merges, και automation.
- GitHub Actions: Automation platform (CI/CD workflows).
- Workflow: YAML αρχείο που ορίζει automation.
- Job: Ομάδα steps που τρέχουν σε runner.
- Runner: Περιβάλλον εκτέλεσης (ubuntu/windows/macos).
- GitHub Pages: Static site hosting.
- Dependabot: Αυτόματες ενημερώσεις dependencies.
- CodeQL: Code scanning για security.
- Branch Protection: Κανόνες για merge στο main.
Ροή CI: Push → Trigger workflow → Run tests → Build → Deploy
Το GitHub Actions είναι μια πλατφόρμα CI/CD που σας επιτρέπει να αυτοματοποιήσετε workflows.
Εργαλεία project management ενσωματωμένα στο GitHub.
Δωρεάν static site hosting απευθείας από το repository σας.
# .github/workflows/ci.yml
name: CI Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Build
run: npm run buildAutomated Testing:
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
npm install
npm testCode Linting:
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run linter
run: |
npm install
npm run lintDeploy to Production:
name: Deploy
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to server
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
# Deployment commands- Πηγαίνετε στο repository → Projects → New Project
- Επιλέξτε template (Board, Table, Roadmap)
- Προσθέστε issues και PRs
Οργανώστε την εργασία σε columns:
- Backlog: Μελλοντικές εργασίες
- To Do: Προγραμματισμένες εργασίες
- In Progress: Τρέχουσες εργασίες
- Review: Σε code review
- Done: Ολοκληρωμένες
# Αυτόματη μετακίνηση καρτών
- When PR opens → Move to "In Review"
- When PR merges → Move to "Done"
- When issue closes → Move to "Done"- Settings → Pages
- Επιλέξτε source (branch και folder)
- Το site θα είναι διαθέσιμο στο:
https://username.github.io/repository
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<title>My Project</title>
</head>
<body>
<h1>Welcome to My Project</h1>
<p>Documentation coming soon...</p>
</body>
</html># _config.yml
title: My Project Documentation
description: Learn how to use our amazing tool
theme: jekyll-theme-minimal
# Create pages in markdown
# docs/installation.md
# docs/usage.mdname: Deploy to GitHub Pages
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build site
run: |
npm install
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./distΑυτόματος έλεγχος για dependencies:
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5# .github/workflows/codeql.yml
name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
- uses: github/codeql-action/analyze@v2- Αυτόματη ανίχνευση secrets στο code
- Ειδοποιήσεις για exposed secrets
- Αυτόματος αποκλεισμός pushes με secrets
Settings → Branches → Add rule:
- Require pull request reviews
- Require status checks to pass
- Require branches to be up to date
- Require signed commits
- Include administrators
Ένα πλήρες περιβάλλον ανάπτυξης στο cloud (VS Code) που τρέχει στον browser.
- Άμεση έναρξη: Δεν χρειάζεται εγκατάσταση εργαλείων τοπικά.
- Consistent environment: Όλοι οι developers έχουν τα ίδια εργαλεία (μέσω devcontainer).
- Πρόσβαση παντού: Κώδικας από οποιαδήποτε συσκευή.
Πώς να το ανοίξετε:
- Πηγαίνετε στην αρχική σελίδα του repository.
- Πατήστε το πράσινο κουμπί Code.
- Επιλέξτε την καρτέλα Codespaces.
- Πατήστε Create codespace on main.
# Εγκατάσταση
brew install gh
# Authentication
gh auth login
# Δημιουργία repository
gh repo create my-new-repo
# Clone repository
gh repo clone username/repo
# Δημιουργία issue
gh issue create --title "Bug report" --body "Description"
# Δημιουργία PR
gh pr create --title "New feature" --body "Description"
# Προβολή PRs
gh pr list
# Review PR
gh pr review --approve
# Merge PR
gh pr merge- Κοινοτική συζήτηση
- Q&A format
- Announcements
- Polls
- Υποστήριξη open source developers
- Τiers με benefits
- One-time ή monthly contributions
# Publish package
npm publish
# Install from GitHub Packages
npm install @username/package# REST API
curl https://api.github.com/repos/username/repo
# GraphQL API
curl -H "Authorization: bearer TOKEN" \
-X POST \
-d '{"query": "query { viewer { login } }"}' \
https://api.github.com/graphql- Δημιουργήστε
.github/workflows/ci.yml - Προσθέστε tests και linting
- Push και δείτε το workflow να τρέχει
- Κάντε το badge στο README
- Δημιουργήστε
docs/folder μεindex.html - Ενεργοποιήστε GitHub Pages
- Επισκεφθείτε το site
- Προσθέστε documentation pages
- Δημιουργήστε νέο Project
- Προσθέστε issues για features
- Οργανώστε σε columns
- Συνδέστε PRs με issues
- Ενεργοποιήστε branch protection για
main - Require reviews
- Require status checks
- Δοκιμάστε με PR
# Conditional workflows based on changed files
on:
push:
paths:
- 'packages/frontend/**'
jobs:
frontend:
if: contains(github.event.head_commit.message, '[frontend]')
# ...jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [14, 16, 18]
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}# .github/workflows/reusable.yml
on:
workflow_call:
inputs:
environment:
required: true
type: string
# .github/workflows/prod.yml
jobs:
deploy:
uses: ./.github/workflows/reusable.yml
with:
environment: production- Pin action versions για σταθερότητα
- Χρησιμοποιήστε secrets για sensitive data
- Cache dependencies για ταχύτητα
- Fail fast στα matrix builds
- Κρατήστε το README ενημερωμένο
- Χρησιμοποιήστε Pages για λεπτομερές documentation
- Προσθέστε badges για status
- Include getting started guide
- Ενεργοποιήστε Dependabot
- Χρησιμοποιήστε code scanning
- Regular security audits
- Χρησιμοποιήστε signed commits
- Δημιούργησα GitHub Actions workflow για tests.
- Ρύθμισα GitHub Pages για documentation.
- Ενεργοποίησα Dependabot.
- Έβαλα branch protection rules στο main.
- Χρησιμοποίησα GitHub CLI για PR creation.
- Τι είναι το GitHub Actions; (α) CI/CD platform ✓ (β) Editor
- GitHub Pages φιλοξενεί; (α) Static sites ✓ (β) Databases
- Dependabot; (α) Ενημερώνει dependencies ✓ (β) Κάνει review
- Secrets στον κώδικα αντί στα GitHub Secrets.
- Workflows χωρίς cache → αργά builds.
- Branch protection χωρίς status checks → broken main.
- Ξεχνάτε να ενημερώσετε documentation.
Ξεκινήστε με απλό CI workflow (tests) και προσθέτετε σταδιακά features.
- Developer push code
- GitHub Actions triggered
- Run linting
- Run tests
- Build application
- Deploy to staging (if main branch)
- Notify team
- Dependabot enabled
- CodeQL scanning enabled
- Secret scanning enabled
- Branch protection on main
- Require PR reviews
- Require status checks
- No force push allowed
- Signed commits (optional)
- Continuous Deployment: Κάθε merge → production
- Continuous Delivery: Merge → staging, manual → production
- Feature Flags: Deploy αλλά ενεργοποίηση on-demand
- CI: Continuous Integration (auto-test on every commit)
- CD: Continuous Deployment/Delivery (auto-deploy)
- Runner: Μηχανή που εκτελεί workflows
- Artifact: Build output που αποθηκεύεται
- Matrix: Παράλληλα builds σε διαφορετικά OS/versions
(π.χ. "Έφτιαξα το πρώτο μου CI pipeline!")
Συγχαρητήρια! Ολοκληρώσατε όλα τα επίπεδα του Git και GitHub curriculum.
- ✅ Βασικές έννοιες Git
- ✅ Daily Git operations
- ✅ Branching και merging
- ✅ Remote collaboration
- ✅ GitHub workflow
- ✅ Advanced Git techniques
- ✅ GitHub automation και features
- Πρακτική εξάσκηση με πραγματικά projects
- Συμμετοχή σε open source
- Εξερεύνηση advanced Git internals
- Δημιουργία custom Git tools
Επιστρέψτε στο κεντρικό README για επισκόπηση όλων των επιπέδων.