You are on page 1of 42

What is Git

Vijay Saini
Git

Git is a distributed version control system (DVCS) that allows multiple developers or
other contributors to work on a project. It provides a way to work with one or more
local branches and push them to a remote repository. Git is responsible for everything
GitHub-related that happens locally on your computer. Key features provided by Git
include:

It's installed and used on your local machine


Handles version control
Supports branching
GitHub Overview

Vijay Saini
GitHub
GitHub is a cloud platform that uses Git as its core technology. It simplifies the process of collaborating on projects and provides a
website, command-line tools, and overall flow that allows developers and users to work together. GitHub acts as the "remote
repository" mentioned previously in the Git section.

Key features provided by GitHub include:

Issues
Discussions
Pull requests
Notifications
Labels
Actions
Forks
Projects
GitHub

GitHub is a development platform that enables you to host and review code, manage
projects, and build software alongside 50 million developers.

Why is everyone building on GitHub? Because it provides the important DevOps


features companies and organizations of all sizes need for their public and private
projects. Whether it's planning features, fixing bugs, or collaborating on changes,
GitHub is the place where the world's software developers gather to make things. And
then make them better.
Issues

Issues are where most of the communication between a project's consumers and
development team occurs. An issue can be created to discuss a broad set of topics,
including bug reports, feature requests, documentation clarifications, and more. Once
an issue has been created, it can be assigned to owners, labels, projects, and
milestones. You can also associate issues with pull requests and other GitHub items to
provide future traceability.
Commits

A commit is a change to one or more files on a branch. Every time a commit is created,
it's assigned a unique ID and tracked, along with the time and contributor. This
provides a clear audit trail for anyone reviewing the history of a file or linked item,
such as an issue or pull request.
Pull Requests

A pull request is the mechanism used to signal that the commits from one branch are
ready to be merged into another branch. The developer submitting the pull request
will often request one or more reviewers to verify the code and approve the merge.
These reviewers have the opportunity to comment on changes, add their own, or use
the pull request itself for further discussion. Once the changes have been approved (if
approval is required), the pull request's source branch (the compare branch) may be
merged in to the base branch.
Labels
Labels provide a way to categorize and organize issues and pull requests in a repository. As you create a GitHub
repository several labels will automatically be added for you and new ones can also be created.

Examples of Labels include:

bug
documentation
duplicate
help wanted
enhancement
question
What is GitHub workflow

A GitHub Actions workflow is a process that you set up in your repository to automate
software-development lifecycle tasks, including GitHub Actions. With a workflow, you
can build, test, package, release, and deploy any project on GitHub.
What is GitHub workflow –
SUMMARYSLIDE-
Workflow is an automated process that you set up in your GitHub repository.
A workflow needs to have at least one job and can be triggered by different events.
You can build, test, package, release, or deploy any project on GitHub with a workflow.
What is GitHub Workflows
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined
by a YAML file checked in to your repository and will run when triggered by an event in your repository,
or they can be triggered manually, or at a defined schedule.

Workflows are defined in the .github/workflows directory in a repository, and a repository can have
multiple workflows, each of which can perform a different set of tasks. For example, you can have one
workflow to build and test pull requests, another workflow to deploy your application every time a
release is created, and still another workflow that adds a label every time someone opens a new issue
GitHub workflow

Steps
Action1
Triggers Uses
Event Workflows
Action2

Action3
GitHub Actions
Vijay Saini
What is GitHub Actions for Azure
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to
automate your build, test, and deployment pipeline. You can create workflows that build and test every
pull request to your repository, or deploy merged pull requests to production.

GitHub Actions goes beyond just DevOps and lets you run workflows when other events happen in your
repository. For example, you can run a workflow to automatically add the appropriate labels whenever
someone creates a new issue in your repository.
GitHub provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host your own self-hosted
runners in your own data center or cloud infrastructure.

https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
What is GitHub Actions for Azure

GitHub Actions helps you automate your software development workflows from
within GitHub. You can deploy workflows in the same place where you store code and
collaborate on pull requests and issues.
permissions
You can use permissions to modify the default permissions granted to the GITHUB_TOKEN, adding or
removing access as required, so that you only allow the minimum required access. For more
information, see "Authentication in a workflow."
GitHub Events
Vijay Saini
GitHub Events
An event is a specific activity in a repository that triggers a workflow run. For example, activity can
originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a
repository. You can also trigger a workflow run on a schedule, by posting to a REST API, or manually
GitHub Jobs
Vijay Saini
GitHub Jobs
A job is a set of steps in a workflow that execute on the same runner. Each step is either a shell script that will be
executed, or an action that will be run. Steps are executed in order and are dependent on each other. Since each
step is executed on the same runner, you can share data from one step to another. For example, you can have a
step that builds your application followed by a step that tests the application that was built.

You can configure a job's dependencies with other jobs; by default, jobs have no dependencies and run in parallel
with each other. When a job takes a dependency on another job, it will wait for the dependent job to complete
before it can run. For example, you may have multiple build jobs for different architectures that have no
dependencies, and a packaging job that is dependent on those jobs. The build jobs will run in parallel, and when
they have all completed successfully, the packaging job will run.
GitHub Actions
Vijay Saini
GitHub Actions
An action is a custom application for the GitHub Actions platform that performs a complex but
frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in
your workflow files. An action can pull your git repository from GitHub, set up the correct toolchain for
your build environment, or set up the authentication to your cloud provider.

You can write your own actions, or you can find actions to use in your workflows in the GitHub
Marketplace.
GitHub Runners
Vijay Saini
GitHub Runners
A runner is a server that runs your workflows when they're triggered. Each runner can run a single job
at a time. GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners to run your
workflows; each workflow run executes in a fresh, newly-provisioned virtual machine. If you need a
different operating system or require a specific hardware configuration, you can host your own runners.
Environment variables

Vijay Saini
Environment variables
GitHub sets default environment variables for each GitHub Actions workflow run. You can also set
custom environment variables in your workflow file.
Commands that run in actions or workflow steps can create, read, and modify environment variables.

https://docs.github.com/en/actions/learn-github-actions/environment-variables
CI
Vijay Saini
CI
You can use GitHub Actions to implement continuous integration (CI) for code that is maintained in
GitHub repositories. CI is the practice of using automation to build and test software every time a
developer commits changes to version control. CI helps teams discover issues early in the development
process and fix them quickly.

https://docs.microsoft.com/en-us/learn/modules/github-actions-ci/2-github-actions-workflows-ci
What are artifacts?
When a workflow produces something other than a log entry, it's called an artifact. For example, the
Node.js build will produce a Docker container that can be deployed. This artifact, the container, can be
uploaded to storage by using the action actions/upload-artifact and downloaded from storage by using
the action actions/download-artifact.

Storing an artifact helps to preserve it between jobs. Each job uses a fresh instance of a VM, so you
can't reuse the artifact by saving it on the VM. If you need your artifact in a different job, you can
upload the artifact to storage in one job and download it for the other job.
GitHub Environment
Variables

Vijay Saini
cdef
dede
Artifacts
Artifacts allow you to share data between jobs in a workflow and store data once that workflow has completed.

These are some of the common artifacts that you can upload:

Log files and core dumps


Test results, failures, and screenshots
Binary or compressed files
Stress test performance output and code coverage results
Artifacts
To share data between jobs:

Uploading files: Give the uploaded file a name and upload the data before the job ends.
Downloading files: You can only download artifacts that were uploaded during the same workflow run. When you
download a file, you can reference it by name.
custom actions

Vijay Saini
custom actions
Actions are individual tasks that you can combine to create jobs and customize your workflow. You can
create your own actions, or use and customize actions shared by the GitHub community.
Composite Actions
A composite action allows you to combine multiple workflow steps within one action. For example, you
can use this feature to bundle together multiple run commands into an action, and then have a
workflow that executes the bundled commands as a single step using that action. To see an example,
check out "Creating a composite action".
Thank You

You might also like