Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 1.14 KB

File metadata and controls

41 lines (35 loc) · 1.14 KB

GitHub Actions for CI/CD

GitHub Actions is a powerful CI/CD platform integrated directly into your GitHub repository.

Key Concepts

  • Workflow: An automated process defined in a YAML file.
  • Event: A trigger that starts a workflow (e.g., push, pull_request).
  • Job: A set of steps that execute on a runner.
  • Step: An individual task, either a shell command or an action.
  • Action: A reusable unit of code.
  • Runner: A server that runs your workflows.

Example Workflow (.github/workflows/ci.yml)

name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run a one-line script
        run: echo Hello, world!
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.

Common Use Cases

  • Automated testing (unit, integration)
  • Building and packaging applications
  • Deploying to cloud providers (AWS, Azure, GCP)
  • Publishing packages to registries (npm, Docker Hub)
  • Automating repository management tasks