Skip to main content

Github Actions

  1. What is GitHub Actions?

    • GitHub Actions is a CI/CD and automation platform provided by GitHub to help automate workflows and tasks in response to events in a GitHub repository.
  2. How is GitHub Actions different from other CI/CD platforms?

    • GitHub Actions is tightly integrated with GitHub, making it easy to automate workflows directly within repositories. It also supports a variety of triggers and provides a marketplace for reusable actions.
  3. Explain the key components of a GitHub Actions workflow.

    • Workflows consist of jobs, jobs consist of steps, and steps consist of individual actions. Workflows are defined in YAML files within the .github/workflows directory.
  4. How do you define a workflow in GitHub Actions?

    • Workflows are defined in YAML files placed in the .github/workflows directory. They specify triggers, jobs, and steps to be executed.
  5. What are triggers in GitHub Actions?

    • Triggers define events that initiate the execution of workflows. Examples include push events, pull request events, and scheduled events.
  6. How can secrets be managed and used in GitHub Actions?

    • Secrets are managed in the repository settings, and they can be referenced in workflow files using the secrets context.
  7. What is a matrix in GitHub Actions?

    • A matrix allows you to define multiple configuration sets for a job, enabling parallel execution of steps with different parameters.
  8. How do you use environment variables in GitHub Actions?

    • Environment variables can be set and used in workflow files using the env context to pass information between steps.
  9. Explain the concept of caching in GitHub Actions.

    • Caching allows you to store dependencies between workflow runs, speeding up the process by avoiding redundant operations.
  10. What are actions in GitHub Actions?

    • Actions are reusable units of functionality that can be defined in separate repositories and used in workflows to perform specific tasks.
  11. How can you share and reuse actions in different repositories?

    • Actions can be defined in separate repositories and referenced in workflows using the uses keyword, specifying the repository and version.
  12. What is the difference between self-hosted and GitHub-hosted runners?

    • GitHub-hosted runners are managed by GitHub, while self-hosted runners are set up and managed on your own infrastructure.
  13. How do you debug and troubleshoot GitHub Actions workflows?

    • Troubleshooting involves examining workflow run logs, exploring the visual workflow editor, and using set-env and echo commands for debugging.
  14. What are artifacts in GitHub Actions?

    • Artifacts allow you to persist data between jobs in a workflow, enabling the sharing of data across different steps.
  15. How do you deploy applications using GitHub Actions?

    • Deploying applications involves defining deployment jobs in workflows, using relevant actions or scripts, and configuring deployment targets.