Junior Front-End Developer
GitHub, Inc. is a provider of Internet hosting for software development and version control using Git. It offers the distributed version control and source code management (SCM) functionality of Git, plus its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, continuous integration, and wikis for every project. Headquartered in California, it has been a subsidiary of Microsoft since 2018.
GitHub Actions actives engineer's to active Agile program development method to deliver results to the users in the shortest possible time without compromising everything on software quality, standards, processes, and security aspects. Actions empower developers to automate the software development lifecycle and allows customization of the workflow wherever needed while it gets executed.
Actions facilitate Continuous Integration and Continuous delivery of software from GitHub repository which ensures code under development is moved to production within a short time cycle so that users get benefitted most by improved accuracy in the application delivery, reduction in the development cost, and improvement in the revenue generation for the organization.
Several components in Actions helps in configuring a development life cycle including testing of software till its deployment. Some of the major components are:
Events
Workflows can be triggered or configured to run whenever an event occurs. An event is a specified activity that can happen as part of Actions or scheduled at a particular time within GitHub or happen outside of GitHub.
Type of events that triggers Workflow execution
Workflow is a set of procedures that are logically connected and made available in the GitHub repository. As described above these workflows are triggered by various events. Workflow is packaged as YAML files and users can create, test and deploy these workflows as a project.
A typical workflow contains various Jobs which have several steps and each step has an action to get the results. Some of the Workflow may be simple and some may be complex that stores sensitive information. Such data like certificates/passwords will use stored as secrets in the workflow as an environment variable and used as parameter during the retrieval of information.
GitHub simplifies the creation of workflows by providing them a master template workflow for users to customize and create their workflow as per the requirement.
Jobs that run as part of a workflow consists of a set of several steps. These steps are getting executed in the same runner to share data among steps. Normally the jobs in the workflow are executed as parallel operations unless there are dependencies between jobs. There could be a dependent job whose execution can start only upon completion of another job. In that case, these two jobs cannot run in a parallel model and they will have to go in a serial mode and it has to be configured in actions as serial jobs.
Steps are part of a Job in GitHub Actions. These steps execute commands, tasks setup, actions defined in the repository. A step may contain an action or a shell command. But action is run as a step in a repository and it is executed as a process in the runner environment with needed resources like file system and workspace. Since each step is considered as its process GitHub does not preserve the changes to environment variables.
Action can be a discrete task or custom codes to interact with repository objects. Actions can be combined into steps and in turn into jobs as part of a workflow. Interfaces available within GitHub or third-party interfaces (API) can be used as part of custom code in action. Actions can run either on machines or through docker containers depending on the need.
It’s a server that hosts the application in GitHub Actions that performs assigned tasks. Users can use the runners provided by GitHub or they can have their runners. Runners execute a job at a time and report back the results to GitHub.
To create a sample workflow all a user need is just a GitHub repository. A directory .github/workflows should be created if it is not already available.
Creation of a sample workflow file
A file github-actions-sample .yml with the following contents can be created in the workflows folder.
The contents
name: github actions sample
on : [Pull]
jobs :
Test-GitHub-Actions-job1:
Runs on: server-name
steps:
Test-GitHub-Actions-job2:
Runs on: server-name
steps:
The above code should be committed to the GitHub repository.
Name: github_actions_sample is the name of the workflow and it will appear in the GitHub actions repository
On: Pull – This code gets executed whenever some objects are pulled from GitHub
Jobs: Test-GitHub-Actions-job1 and Test-GitHub-Actions-job2 and the steps are defined in
When the job runs
Whenever some users try to pull out any objects from the repository the above code as part of the will get executed. This code displays the Event name, server name, and repository name.
Overall GitHub Actions simplifies the code management activities and shrinks the development time by automating several processes in the software development life cycle.