Question 1: What is GitHub Actions?
Answer 1: GitHub Actions is a CI/CD tool to automate workflows directly within GitHub repositories.
Question 2: What are GitHub workflows?
Answer 2: Workflows are automated processes defined in .github/workflows/*.yml files.
Question 3: What is a job in GitHub Actions?
Answer 3: A job is a set of steps executed in a runner.
Question 4: What is a runner in GitHub Actions?
Answer 4: A runner is a machine that executes workflow jobs.
Question 5: What are GitHub-hosted runners?
Answer 5: GitHub-hosted runners are managed by GitHub and run workflows in virtual machines.
Question 6: What are self-hosted runners?
Answer 6: Self-hosted runners are user-managed machines for executing workflows.
Question 7: What is a step in GitHub Actions?
Answer 7: A step is an individual task within a job.
Question 8: What is an event in GitHub Actions?
Answer 8: An event is a trigger that starts a workflow.
Question 9: What are some common GitHub Actions events?
Answer 9: push, pull_request, schedule, workflow_dispatch.
Question 10: What is the syntax of a GitHub Actions workflow?
Answer 10: YAML (.yml) syntax.
Question 11: Where are GitHub Actions workflows stored?
Answer 11: In .github/workflows/ directory.
Question 12: How do you trigger a workflow manually?
Answer 12: Using workflow_dispatch.
Question 13: What is on: push in a workflow?
Answer 13: It triggers a workflow when code is pushed.
Question 14: How do you specify a specific branch in a workflow trigger?
Answer 14: Use on: push: branches: [branch-name].
Question 15: What is on: pull_request?
Answer 15: It triggers a workflow on pull request events.
Question 16: What is a matrix in GitHub Actions?
Answer 16: It allows running jobs with multiple configurations.
Question 17: How do you define environment variables?
Answer 17: Using env: in the workflow.
Question 18: How do you access environment variables?
Answer 18: Using ${{ env.VARIABLE_NAME }}.
Question 19: How do you store secrets in GitHub Actions?
Answer 19: Using GitHub repository secrets.
Question 20: How do you use secrets in workflows?
Answer 20: ${{ secrets.SECRET_NAME }}.
Question 21: What is jobs.<job-id>.strategy.matrix used for?
Answer 21: It enables parallel execution with different parameters.
Question 22: How do you define a job dependency?
Answer 22: Using needs:.
Question 23: Can jobs run in parallel?
Answer 23: Yes, unless dependencies are defined.
Question 24: What is an artifact in GitHub Actions?
Answer 24: A file or data stored between jobs.
Question 25: How do you upload artifacts?
Answer 25: Using actions/upload-artifact.
Question 26: How do you download artifacts?
Answer 26: Using actions/download-artifact.
Question 27: What is the default shell in GitHub Actions?
Answer 27: Bash.
Question 28: Can you use PowerShell in GitHub Actions?
Answer 28: Yes, by specifying shell: pwsh.
Question 29: How do you run a specific script in a step?
Answer 29: Using run: ./script.sh.
Question 30: How do you define an action?
Answer 30: Using uses: owner/repo@version.
Question 31: What is a reusable workflow?
Answer 31: A workflow that can be called from another workflow.
Question 32: How do you call a reusable workflow?
Answer 32: Using uses: with a path to the workflow.
Question 33: What is an if condition in GitHub Actions?
Answer 33: A way to conditionally run a step or job.
Question 34: How do you check the status of a previous step?
Answer 34: Using if: success(), if: failure().
Question 35: How do you trigger a workflow at a specific time?
Answer 35: Using on: schedule: with cron syntax.
Question 36: What is a composite action?
Answer 36: A custom action combining multiple steps.
Question 37: What is the default timeout for a job?
Answer 37: 360 minutes.
Question 38: How do you set a custom timeout?
Answer 38: Using timeout-minutes:.
Question 39: What is continue-on-error?
Answer 39: Allows a step to fail without failing the job.
Question 40: How do you cancel a running workflow?
Answer 40: Via the GitHub Actions UI or API.
Question 41: How do you debug a failing GitHub Action?
Answer 41: Enable ACTIONS_STEP_DEBUG secret.
Question 42: What is GITHUB_TOKEN?
Answer 42: An auto-generated token for authentication.
Question 43: How do you pass data between jobs?
Answer 43: Using artifacts or outputs.
Question 44: What is a GitHub Actions environment?
Answer 44: A deployment environment with specific secrets.
Question 45: How do you rollback a failed deployment?
Answer 45: Use a previous release or redeploy a stable version.
Question 46: Can GitHub Actions deploy to AWS?
Answer 46: Yes, using AWS CLI or GitHub Actions for AWS.
Question 47: How do you deploy to Kubernetes?
Answer 47: Use kubectl in GitHub Actions.
Question 48: How do you cache dependencies?
Answer 48: Using actions/cache.
Question 49: How do you test a GitHub Actions workflow locally?
Answer 49: Using act CLI.
Question 50: How do you restrict a workflow to specific branches?
Answer 50: Using on: push: branches: [main].