Github Actions Certification Flashcards
What is the primary purpose of GitHub Actions?
To automate software development workflows.
What are the three main components of a GitHub Action?
Workflows, Jobs, and Steps.
What is a GitHub Actions workflow?
An automated process added to a repository to build, test, package, release, or deploy a project.
What is a GitHub Actions job?
A section of the workflow associated with a runner.
What is a GitHub Actions step?
An individual task that can run commands in a job.
What triggers a GitHub Actions workflow?
An event triggers the workflow.
What is a runner in GitHub Actions?
A machine where the job runs, can be GitHub-hosted or self-hosted.
What attribute specifies the runner?
The runs-on: attribute.
What are actions?
Standalone commands that are executed within a workflow.
What is the uses: attribute in a step?
It specifies the path to the container action defined in an action.yml file.
How can you schedule a GitHub Actions workflow?
Using the schedule event with POSIX cron syntax.
What is the workflow_dispatch event?
Allows manual triggering of a workflow via GitHub REST API or the Actions tab.
How can you trigger a workflow for external events?
Using the repository_dispatch event and sending a POST request to GitHub.
What are conditional keywords in GitHub Actions?
Keywords like if that allow you to evaluate expressions and run steps conditionally.
How can you disable a GitHub Actions workflow?
You can stop it from being triggered without deleting the file, either on GitHub or through the GitHub REST API.
What is the purpose of a GitHub Actions workflow file?
To define the automated process for building, testing, and deploying code.
What are the two main components of a GitHub Actions workflow?
Jobs and Steps
What is the default name of the GitHub Actions workflow file?
.github/workflows/main.yml
What is the purpose of the on keyword in a GitHub Actions workflow?
To specify the events that trigger the workflow.
What does the jobs section in a GitHub Actions workflow define?
It defines the tasks to be executed in the workflow.
What are GitHub-hosted runners?
Virtual machines hosted by GitHub to run workflows.
What is the purpose of the runs-on keyword?
To specify the type of runner to use for the job.
What are self-hosted runners?
Runners that you host yourself in your own infrastructure.
What is the purpose of the steps keyword?
To define a sequence of tasks to be executed in a job.
What does the uses keyword do in a GitHub Actions workflow?
It specifies an action to use as part of a step.
What is the purpose of the env keyword in a GitHub Actions workflow?
To set environment variables for the entire workflow.
What does the if keyword do in a GitHub Actions workflow?
It adds conditional logic to the execution of jobs or steps.
What is the purpose of the matrix keyword?
To define a set of different configurations for a job.
What is the purpose of the needs keyword in a GitHub Actions workflow?
To specify job dependencies.
What is the purpose of the strategy keyword in a GitHub Actions workflow?
To define a set of different strategies for matrix builds.
What is Continuous Integration (CI)?
The practice of automatically building and testing code changes.
What is the purpose of the pull_request event in GitHub Actions?
To trigger the workflow when a pull request is created or updated.
What is the purpose of the push event in GitHub Actions?
To trigger the workflow when commits are pushed to the repository.
What does the jobs.<job_id>.strategy.matrix syntax allow you to do?</job_id>
Run a job with multiple different configurations.
What is the purpose of the jobs.<job_id>.steps.run syntax?</job_id>
To run a shell command in a job step.
What is the purpose of the timeout-minutes keyword?
To set a timeout for a job to prevent it from running indefinitely.
What is the purpose of the jobs.<job_id>.container syntax?</job_id>
To specify a container to run the job in.
What is the purpose of the jobs.<job_id>.services syntax?</job_id>
To specify additional services that the job requires.
What does the jobs.<job_id>.strategy.fail-fast option do?</job_id>
Stops all matrix jobs if any matrix job fails.
What is the purpose of the jobs.<job_id>.continue-on-error option?</job_id>
Allows the workflow to continue even if the job fails.
What is GitHub Packages?
A package hosting service integrated with GitHub.
What types of packages can be hosted on GitHub Packages?
Docker, npm, NuGet, Maven, and more.
What is the benefit of using GitHub Packages?
Simplifies package management and deployment.
How are permissions for GitHub Packages managed?
Based on the same permissions as the GitHub repository.
Can you use GitHub Actions to publish packages to GitHub Packages?
Yes, GitHub Actions can automate the publishing process.
How do you specify the registry for GitHub Packages in a workflow?
Using the registry field in the publish step.
What is the purpose of the GITHUB_TOKEN in publishing to GitHub Packages?
To authenticate the GitHub Actions runner with GitHub Packages.
What is the name field in a GitHub Packages workflow?
Specifies the name of the package.
What is the version field in a GitHub Packages workflow?
Specifies the version of the package.
Can you publish multiple packages in a single workflow?
Yes, by defining multiple publish steps.
What is a code package in GitHub Packages?
A reusable piece of code that can be downloaded and used in different projects.
How do you install a code package from GitHub Packages?
Using package managers like npm, NuGet, or Maven.