Exploring Community GitHub Actions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
great we are live uh hey everyone welcome back to another episode of tech talks with santosh and today we have a really special guest nishkesh who is an github star and he works as a devops engineer so we will be exploring uh some community created github actions that's what nishkas is going to show us today so uh pretty excited for it thanks a lot nishikash for joining us today thanks santosh for the invite uh you're you're doing some amazing work in the for the community and i love the tech talks and hope to do a lot again ah thanks thanks a lot uh so yeah so let's move on and let's start with so uh would you like to introduce yourself us sure definitely uh my name is nishkesh i am a principal devops evangelist and consultant at status neo india status neo is basically a global agile firm which be which deals in cloud native consultancy uh and the domains that we focus on on our data digital and devsecops apart from that uh i am an avid github and i love to contribute in towards the open source and teach people about ways to perform and ways to grow their uh skill set in the field of open source and i'm also a github star so that's pretty much it that's great that's great so uh in case you are interested at the end we will talk a little bit about github stars and what the program is and in case you are interested so otherwise let's move on and uh so uh tell us about github actions what are what is the github action and what are these different use cases which we have for using it up actions sure i would love to so basically if we skip directly talking about github actions i'll like to talk about automation first uh in the field of iit and software engineer we always come across jargons like i s automation ci cd and whatnot but understanding them from the deep within is very important so automation is basically reducing human work and that means we have to find out which work has to be removed off development is something in software engineering which has to be done by humans itself but there are different tasks which include building the code checking if there are some test cases errors if the code quality is correct deploying it to artifactory or to the container registry all of these tasks are not something that developers should work on these are extra tasks and these are routine tasks which can be automated and github actions is github solution for automation so it is basically in it at its core github ci cd tool but nci cd yci cdi means continuous integration and continuous delivery but apart from that it's a lot it's a lot of automation for you it allows maintainers to have a easy life by automatically reviewing the prs that is pull request and apart from that you can have notifiers like this you can send notifications to your discord or your slacks and yeah are always aware of whatever is happening on your depository and there are lots and lots of amazing data actions created by community which i'm going to demonstrate today so uh i i believe i mean i'm sure you will agree with this so i believe actually after uh so many years i github actions was one of the revolutionary thing which happened to the dev uh deveco system i mean it has i have seen some amazing use cases being uh created by the community and they are amazing i mean i never thought that that is something which can be done by it actions i'm sure you are going to cover a lot of them but what do you what is your thought on that correct so basically github actions launched in 2019 and at that point of time i was unaware of what automation but when once that process when that feature was released i got the beta access and i started exploring it and i realized that technology is not very difficult to handle and it is extremely easy to create an automation engine by using github actions and to be very honest the more i have used actions the more i feel is the first steps are important you should never fear technology once you start building technology especially with github producing amazing user friendly or developer friendly tools like github actions it is extremely easy to catch on and grow your skill sets in the domain so yeah let's move let's uh so uh you are going to present some of the community github actions would you like to share your screen sure i'd love to yeah so just add it let me just add the screen and yeah uh can you please tell me if my skin is visible yes it is visible okay so we have already covered the initial slides that i have created uh but uh i'm gonna skip all of these so let's uh get to the agenda for today so we'll be talking about community git of actions and github actions in general uh initially i'll be talking about github action 101 that is the introduction to actions uh which we also covered a lot of part initially and then we'll be talking about the first steps as i said the first steps to learning a technology or a tool set is extremely important and that's what i'm going to cover and i'm going to show how easy to create your first github actions and host it on github marketplace apart from that i'm going to cover maintainers corner where i'm going to create a maintainers friendly community kit of actions i'll then move ahead to github actions core domain that is ci and cd and try to replicate an end-to-end pipeline and show how it is so easy to create this pipeline for devops then i'm going to talk about notifications and how github actions can help you with that so i'm going to demonstrate uh github actions used to notify the maintainers in their discord and slack channels apart from that i'm going to talk about miscellaneous amazing github actions that the community had created so this is a quiet depiction that i created in my mind so i talked about automation and its importance uh on the left side you will see some images uh let's skip the robot for a second uh there is siri there is google uh there is alexa all of these devices are our personal digital assistant they help us by doing tasks uh which we are not uh which are which are or which can be automated like telling us what is our today's calendar what are today's meetings and what not you can ask them to play a song as well now uh imagine in iit you have a robot that does the non-tedious task for you that does the work which the developer should really not do and if you go into the left side sorry on the right side you will see a human who is chilling who is enjoying the cash because someone is doing their job for them and they're only working on what they like so uh santosh here is my depiction of what a sdlc life cycle means for me so this is an entire end-to-end pipeline which i like to call it and so let's talk about this as i said developers should only focus on coding and everything apart from it can be automated so initially there are developers i have demonstrated developers around the globe because now in today's era of lockdowns and all of that we are doing work from home but still we can collaborate in a distributed environment using hosted cloud-based version control systems like github and all so we are separated by the by the uh geography but we have cloud-based sem hosting like github azure devops and more this feeds to the ci and cd pipeline the ci or the continuous integration pipelines has five phases for me i mean it can differ for different definitions but these are the core phases the first one is the build phase i'm gonna take an example so suppose you are creating a project in java then your build tool or the dependency management tool is apache maven or gradle similarly if you're using a react.js or angularjs application you have a npm for a build tool then there are different test uh frameworks like for again i'm going to take java example more and more because i'm more acquainted to that for testing there are frameworks like apm uh then test ng junit and next comes reporting tools so there are different reporting tools like sonar cube sorry it's not a reporting tool like jacoko for code coverage and pmd for uh checking the code quality then there is sca that is static code analysis uh static code analysis will tell you whatever the bugs are whatever the vulnerabilities are in your code and the code quality and for that there are two likes one argue then there comes rtfactory so if you're using java you will create uh jar files or the var files which are the build or the executable files and they are hosted on an artifactory like jfrog and all all of these process that i talk about the ci pipeline can be automated and this is why this pipeline in devops arena is called continuous integration because this has to be automated and i'm going to talk about how you can do this with github actions uh in the later demonstration apart from that comes the continuous delivery life cycle so again uh not to be confused with the up above layer another testing phase has come but this testing is not related to your code it is related to your servers so there is performance testing load testing penetration testing for security and a lot of different tests can happen apart from that there is a uat that is user acceptance test you can have alpha and beta users uh testing your environment before your public release has been created then comes the staging environment so staging is basically a replica of the production environment but it is not accessible to the real end users and then comes the production environment where you deploy your servers so how can this process be automated let's uh start uh so basically i'm going to skip the slides now uh since we have already discussed about github actions and we will just go ahead and see the power of actions in action okay uh so i have created this repository i'm going to make this public and i'll ask you santosh to add this in the description of the video so that viewers can use this okay so uh we'll start with the first step that is creating the first hello world github actions and hosting it on get a marketplace so i'm going to create a new repository right now because for hosting your repository in the marketplace you actually have to have a single repository because the repository you are hosting it get a mark action marketplace there has to be only one single database you cannot have multiple data in a single repository that your host so let's just give it a unique name let's say 11th of june i hope the spelling is right i'm going to make it a public repository because if you are not creating a public repository you cannot post it in the github actions marketplace uh before i talk about marketplace uh i'm talking it without any context so we'll go into the github actions marketplace and these are all the amazing github actions that community as well as the githubs team have created for us to make our life easy and you can test this out i have added the link to this uh in the repository here alongside some amazing community github actions so these are uh when github actions just launched uh github were by the tag sgrass created a repository and all the amazing github actions have been dragged here and this is a very um famous repository because people love github actions and they are tracking some amazing data actions here so i'm creating another new repository uh let's skip these things although you should add them but i'll add a license because without a license you cannot post your github actions to marketplace and as i said creating a github action is extremely easy you just have to go to your actions tab in the repository and once you get here you have to click on setup of workflow yourself and there you go you have a template github actions created by github themselves all the github actions uh workflow that you create are stored at the root folder in dot github workflows folder and they are written in a language called yml so you can see the file name is main yaml you can replace it but i'm going to keep it that way let's read the syntax a little bit and see what happens here the name is basically the name of github actions you want to give so let's say hello world because they're creating a hello world of actions the first thing you do in it uh whenever you're learning new thing is hello world then github actions are triggered by events happening and if you are acquainted with github you know there are events like creating a push event or creating a pull request that is an event or creating releases on you of your repository that is the event so on basically is a keyword that tells when this github actions has to get triggered so i'm going to say only push for now and even on push push events you can specify which branches to look for so i'm going to go on the default branch which is the main branch and when i let this flow work for dispatch basically means that this automation automation action you can also trigger manually so i'm going to let it be as well then basically you can list a number of jobs that you want this action to perform and runs on basically means which uh parent os you want this application to run on so i'm going to use ubuntu latest ubuntu is basically a linux favorite flavor and you can run various linux commands on here then if you see the first step all most of the github repositories github actions start with this step that is actions checkout checkout basically means everything that you've written in the repository can be used inside this github actions and we i'm going to tell you the significance of this when i'm creating more important data actions later in the demonstration then uh you you can run uh shell commands shell basically for uh linux can be bash shells is shell and c and more so you can run a single line command so here it is echo hello world echo basically means a print like statement like a print in python or a or a printf in c then you can use a run a multiline script so i'm going to show you some commands that really matter with a multi-landscape basically i'm going to type ls that is going to list all the files that are there in the specific repository where this action is running and then i'm going to type pwd pwd is a present working directory so it's going to tell me the directory where this action is running and you have to create a commit message my first action uh this has to be meaningful but right now it's not important to do a meaningful task and once you click on commit you have created your first github actions and it was extremely easy to do so you did not even have to learn how to code you just have to understand the syntax that they are giving you and you can build on top of that it's going to take a few seconds and we are going to get the results and santosh here we are the first actions has run successfully so the first line script was uh printing hello world so hello world is there and in the multi landscape i wrote ls and pwds so till now i have just created a license file in my repository so it shows a license file and pwd basically tells me what is the directory so this is the default directory uh that the github actions uses this is the name of my repository and it creates a folder with the same name as the repository inside it after you have done this uh i guess you have to create a readme as well before hosting your github actions [Music] sorry my bad i'll have to add a readme so let's create a readme.md file let's say hello world actions and type in this is a demo or github actions i'm going to commit this once that has happened we can go ahead and release it to github actions marketplace so i've returned the code for it so we can quicken this up [Music] let's add a file so to host your github actions to the get action marketplace you have to create a file called action.yml at the root of your repository so i'm going to copy this and the syntax basically means you will have to name so this name would appear on github actions marketplace that you are hosting on the description is basically uh alongside what will come you can name your user server author then the input and output you can specify and the github action that i have created was using dockers because we are using a linux base uh you can also create github actions by using javascript if you are acquainted with that and then you can create the branding so what will appear on action marketplace you can add a photo here but i'm gonna choose a color right now and add create this actions file so once you have done this okay my bad so i created directions.yml file here rather than on the right repository sorry i'm getting a little nervous oh it's okay live coding is hard so don't worry so hopefully now if i refresh i'm gonna get and here you go so it is not difficult to create a release to marketplace now you just have to create a release and your github actions will be hosted on get a marketplace so you have to accept the agreement before you can create this release just do that and it will create a validation whether you can you have everything required to create the release then you can choose category of github actions you have affiliated uh do i see a relevant category that i have created for i don't so let's say container ci or you can use community as well and give a tag version so it's 1.0 and i guess release that will be 1.0 and you can publish a release it would ask for my password i hope this is still correct and there you go you have created this release in the github actions marketplace so you have option called view on marketplace if you click on that you can see your github actions is hosted on marketplace and it was not difficult at all and anyone can create github actions uh and host them on marketplace so this is how a community create the github actions and host it online [Music] deployments are difficult i'm going to come on that side as well uh so let's move to the next part uh so we have to create uh some github actions that are helpful for the maintainers so let's do that as well i'm because we are short on time so i'm going to create only a few github actions that help the maintainers if you go to the bottom of the page where you create a new github actions you will see some actions that help help the maintainers so i'm going to set up this github actions which is a greetings action whenever someone new outside your organization or someone who has not contributed to your repository comes in and creates their first issue or a first pull request this kit of action would give them a custom message so that they feel involved until and unless the maintainers come and review their issue or the pull request so let's leave the syntax very quickly so name is greetings it can be anything and it runs on two pull events that is the pull request event and the issues even as i just told you apart from that it runs on ultra latest again and one thing that is important here is this to run this kit of actions you have to specify your github token and where you specify those github tokens are if go to the settings tab of your repository inside that go to the secrets in the sidebar and you can specify your tokens here i have already done that because doing it on the live stream would not really be a good thing to do so i have saved my token here but i will tell you how to generate those tokens you just go to settings of your account and that go to developer settings and then you go to personal access tokens here you can generate a new token and you can store that in your secret file once you do that you can create a custom message for the issue or the pull request that will happen i'm not going to change that for now and just create this greetings or yaml so what will happen now is my greetings or yaml would run oh sorry it would not run because it was not going to get triggered on a push action it will get triggered on a full request or isolation so let's go ahead and create a small issue let's say unrequited issue because it's really not required to create iso at this point of time is this actions working and it's gonna throw some message that was uh written by default by the main creator of the github actions let's see if it's running oh yes it is running once it's run successfully i get i think i'll get the message uh let's wait anything interesting about this that you want to ask uh yeah so there was a question from lars and i'm sure this is a pretty uh common question so so it's possible to have multiple actions hosted and published in the same repo so uh is it possible right now because i don't think so so basically uh as far as i remember from the documentation i think that uh your github actions can be hosted if and only if there is a one action in your repository you can have multiple actions definitely but i don't remember if you can host uh multiple actions from the same repository okay so i think uh oh that's already uh mentioned it so let's say that i think it was recently done so you can actually create a public action in every folder so you can have multiple folders with separate action.yml and it will do that sure good to know i'll read more around that okay it's completely so apart from that there is another uh question from la so his question is github actions are as serverless a serverless function will it happen hopefully it should happen hopefully it should happen because we all want serverless because it's the next gen solutions and everyone wants to remove the infrastructure part we just want to host our code and it should result in an output it should be a black box so hopefully in the near future several less data actions are coming soon but i am i'm sure it will uh so right now actually github actions are getting abused a lot so do you think it will not abuse i mean people will start abusing more if this this functionality comes probably they can make it paid yes i'm sure i'm sure github would uh think about that and keep it in mind because there were some issues recently about github actions like people were mining it for cryptocurrency but those were handled so github has a good uh feedback management system and they do keep a checkout on these all of these issues and hopefully that those things will not happen let's see correct uh so this github actions has done successfully and i hope i'll have a response here on the side and it says it github actions tell me message that will be displayed on the user's first issue so it's not really something uh significant or of sense but it has worked itself we can create a custom message but that is for another day so let's talk about uh the real use case of github actions by a small end-to-end pipeline so i'm going to create an apache maven project and apache maven is a build tool and a dependency management tool for java and the project that you create in java so i'm going to go to my local machine and open my visual studio so i've already cloned this repository i'm going to pull the latest once i've done that i have also created apache maven project so i'm gonna copy that to here but before that uh let's why not use some important features of github that they provide like i'm going to create a github uh i'm going to create a github sorry i'm going to create apache even project in github so let's use a feature called get ignores you take notes are basically is a file where you can tell github to get or even the git vcs to not track files which are of no importance to source control so basically jar files text files pdf files which are not code files are not important and it should not be stored in a version control and should be ignored for that let's get a dot again ignore file for maven when we do that here uh amazing feature on github it already gives us a list of community created or a github man maintained getting notes so i'm going to use maven and you will see a lot of things that come here these things are related to apache maven release process and this is target where the real jar or wire files are stored so i'm going to create this get a good file apart from that i'm going to create a significant git of actions of that is used for build checks so as i said apache pavement is a build tool right you create a java code and apache even will create a jar file out of it but it is a standard practice you should know and everyone who is using it app should know you should never commit directly to your master branch or the default branch which is now main for github and so that's why pull requests are used you should never commit directly to master branch if you want to collaborate on the repository you should uh create that in a separate branch and create a pull request to the default branch but to but the tool simplifies the use case or the life of maintainers the maintainer should not go and do a non uh non-required task like checking if the pull liquid is correct it is building correctly or not why not create a github actions which creates a build and test it for you so let's go ahead and create apache maven build whenever a pull request is created it will test if the build apache maven is building correctly or not sorry it's late in the night time and i'm feeling a little dumb today no it's okay so i'm going to create an even dot yml file uh and name is java ci with naven and as i said it will run on pull request onto the main or the default branch whenever somebody comes and creates a pull request it will create a build out of the source code and check if it is running successfully or not if it is something successfully then you should merge it otherwise you should not merge it and all it does is installs apache sorry installs java 11 on your ubuntu machine and then runs engine clean install so clean install is basically a goal in apache maven clean deletes pre-existing target files or the jar files and install is basically a life cycle that creates the jars or bars for you okay so let's create this and it will not get triggered obviously because it's on a pull action pull request [Music] so on my local machine let's uh come here and create a new branch so we do that with it branch and let's say mvn from even we're gonna check it out we're gonna move to that branch and you as you see the branch shifts from main to nvn and i have stored the maven sample maven project so in one local machine i'm going to copy that it should be i guess this or i don't remember the name of the project hello so it's basically sample maven project i'm gonna copy that let's use a little linux and say minus rf that is recursive and forcefully and every content of this project should come on dot which is the current current folder so if i have type in ls you can see the src and the form.xml has come and you already have it here so let's go to visual studio code and for people who are new to apache naval uh basically apache maven creates is used for java it's a dependency management and a hierarchy tool so it creates hierarchy all the main main files or the source files are stored in your main inside that java inside your package name and then there is a file name similarly there is a test folder for the for the similar hierarchy and your dependencies are stored in a file called xml for people who are uh more acquainted with javascript uh and react at least as far as i know there is a file called packet.json which is just a similar task okay so if i go to uh just uh before creating a pull request i'm going to test it out tested this project out locally so and in clean install similar tasks that i created in github actions i'm going to run it here to test if it is working correctly or not and hopefully it is running correctly it must not take more than two seconds uh that's it it is building successfully and this is what we want it should not fail in the ci otherwise we will have to reject the pull request so let's put these changes here uh if i do get status uh i have to add these and since uh target file has not been here should not be here i am going to go on i created a get ignored but it's not here i guess get check out master sorry master punch is not exactly the main run correct and i'm gonna go do a gate pull so the getting note should come right away and i'm going to go ahead back to give him check out master mvn and once we are back on the maven repository we have to merge these changes so get merge master sorry so we are sync with the mastermind if i do crit status again uh you you should see that the target folder is not in track by github you're sorry databases again so i'm going to get add dot get commit apache maven project and i'm going to push these changes so you have to tell that your upstream is origin which is the default link name and your branch and that is mvn and these changes are pushed to the branch called mvn if you are acquainted with github cli you can create a pull request from this command line but i am going to do the newbie task and go to the branches from here and then create up a request that's what i do it is what it is so we are on the ambient branch sorry we are on the mpn branch not on the main value but we can still create a pull request out of it so when i click on pull to create a pull request now my github actions would get triggered on the pull task and you see two two actions have been triggered the ratings because it's my first time creating a pull request on this repository and the java ci and you should only be allowed to uh merge this pull request if this ci pass is right and while this might take one minute or so to build i'm going to shed light on amazing github feature that they have incorporated i'll go to settings and i'm going to go here and say allow auto merge so once again the maintainer should not do a manual task of coming on this pull request again and again and seeing if the ci has passed or not just to click on merge pull request if the ci is passing successfully you can create auto allow auto merge and it will get automatically merged into the default branch but i'm not going to do that right now i'm just shed light on that and my ci is successfully passed and i i am going to merge this pull request so now my maven project is on the repository here let's move ahead and those are executables that should be stored in an artifactory there are different artifactories available like azure has its artifactory feeds then there is nexus there is jfrog github has its own solution to this that is called github packages and it allows you to host different types of packages like npm name and new date and many more so i'm going to push these get a packages sorry these jar files that i'm going to create with my maven project directly to get a packages by using it of actions next so uh to specify which url that is the package registry followed by your github username followed by your repository name your name and project should look to you you have to add this into the dependency file that is the form.xml so i'm going to copy that and i think i'm still on the ambient branch i'm going to switch to the main branch finally i wrote mean at one go i'm going to fill the latest changes and now i'm going to specify the repository here what that basically means is that when i type in mdm deploy from my local machine i can push the jar files that i have created directly to the payment registry it will take a little time and it will push those changes i see errors here unprocessable entity so i guess i have to do a clean install first yeah so i clean installed on another branch i did not have the target file here so that might be the cause of the issue hopefully this should work otherwise i'm going to cry so meanwhile uh we can take this question i think guraj has this question can we run unit test same as build on github actions hopefully yes obviously uh if you there should be a option to run those tests and once again it is failing i do not have an idea of why unprocessable entity probably uh version i mean npm generally it fails in case you are trying to deploy the same version correct uh basically i deployed this project in the morning as well so that's why that's why it is causing an issue [Music] so basically this should be working i'll go straight ahead to another repository that i created in the morning while i was trying to prepare for the demonstration and go to the awesome actions uh and i'm going to talk about this github actions we are also short on time so i'm going to skip these and move towards the notification after this so what this this github action would do it is similar to the previous data action it will clean and install first so that the jar files exist in the docker image where this github action is going running after that you are going to publish this engine deploy would happen and it will use your github token and push your maven files sorry the jar files that you have created to the apache maven repository so if i go into awesome actions you can see that these packages already exist here so this is a get a package and that's what you are what you are saying is correct i am deploying it again with the same version and that's why it is giving me an issue but you see that this executive action is already working okay so i'm going to another uh do another task here that is uh let's leave apache maven and the jar files for a second let's talk about dockers for a file what about dockers uh so people say that java is platform independent and uh once you create a java project on one machine it should run on all versions on all machines right but that is actually not true uh because you might be using different versions of java like you have created a project in java 11 and the latest java is java 16. there might be some functions that you have used that have been deprecated and not being supported anymore this issue will not happen with when you're using dockers or containers in general containers are really platform independent and they are the future so if you're using if you created a container image you can share those anywhere across the world and if a machine has a container run time that container container engine sorry that the container image would run successfully every time so platform independence is truly uh visible in dockers so rather than pushing maven jar files on game packages let's push the docker images let's then encapsulate those jar files in a docker image and push them uh so basically i'm going to copy files from here now so that we are actually short on time it's okay you can take some extra time if it's possible definitely i would i'm not going to go without doing everything i have prepared so to create a doctor image basically you have to create a write a docker file and the syntax is pretty easy from is the first and it is a mandatory command and it is what the base image you want to use it is a java project so i'm going to use the open jtk image with the lavend version and i'm going to expose 8080 port so this is the port where this endpoint would be exposed apart from that as i said my jars file or the executable files are always in the target folder so add basically means whatever you have outside the docker image you can add those files inside the docker container so add will go into the target folder pick up the jar files star dot jar is a wild character and it will fetch all the jar files and paste them as a test.jar in my docker image and entry point is the first command that would run in your docker container so uh just to explain the jargons there are two main entities in a in the world of dockers that is a docker image and a docker container a quick uh and a easy explanation would be think of that as a class and an object class is a template that you create an object is its runtime similarly docker image is the template that you create or a base image and the containers are actually its runtime instances so this docker file creates a docker image when you run the docker image into a docker container entry point would be the first command that would fire and it will execute this jar file by using java so i'm going to copy this docker file and go here on my repository add a file called dockerfile wow that's here and i'm going to push this on the default uh root of the repository i'm going to create this github actions quickly i hope i can copy it from here go to actions tab click on new workflow and once again even though i am copying it from my readme file these all github actions are created from the community and all of them are be credited in the readme file so basically the two links that have written in the readme files these actions are taken from there and created by the community so if you look into this github actions you will see that it requires two secrets again that's the username of your docker hub and your password so i've already stored that in my secrets file it will create a docker image called your username that is your docker username followed by the name of the image that you're creating so that's i've written and i'm going to create it on a push so if i commit this okay rename rename this to docker. and hopefully it will work now uh while it runs i can take a question i think we don't have any questions for example well there are two i don't have idea why there are two but uh maybe just because i refreshed them that's why it happened so uh there are a lot of steps that are happening i'm going to remove this so setup java so basically java 11 is installed in my docker image then it is creating a build once the build is created the target folder would be inside the docker image right docker image is running then it will create the docker image by using the docker file that i have written then it will log into docker so docker hub is where my image would be stored and then docker push would happen and it will push the docker image created inside the kit of actions to the docker docker hub is basically github as database for source code docker hub is for docker images and this action has run successfully and if i go to docker i think i have already logged in there is hub.docker.com uh and it's pushed a few seconds ago from my github action i did not even open docker up to push my image from data actions so that's how it's simple and how uh income passing data actions is it includes a lot of different uh tool sets and just abstracts them from for you so that it is easy for you uh next up i'm going to talk about dependable so dependable basically was a product created by independent uh people alongside guitar it was called a product called dependable preview as i said uh npm has a dependency file called package.json apache never has our dependency file called form.xml python has requirement.txt it basically lists down the dependencies that your source code project requires and defender board is basically a tool that keeps a regular check on those dependency files and see if latest version has come in the market so i do not know about npm but apache maven has a central repository called the maven central repository where the latest dependencies are stored similarly python is pi pi and depending what keeps the check and sees if there is a version that is new inside the central repository that can be incorporated inside your project and whether it is compatible or not so you can create a github actions or not action it's a config file inside your project and it will keep a check on your dependencies but a quick reminder the dependable file should have should be written in on dot getter folder not dot github slash workflows you create a dependable.bml file and leave this syntax here version is basically the version of dependable tool that you're using and github sorry dependable is has now been acquired by github and they have incorporated that incorporated that inside github as well so to see that you have to go inside the insides folder once you go then inside folder you can go to dependency graph and move to the defenderbot tab and you can enable dependable from here as well and you will get a ui to see the dependencies but i am going to write a code because i like to code a lot of tools so basically uh package ecosystem basically we are using apache maven directory is where your dependency file exists so my form.xml is at the root of the repository so i'm using slash and schedule you can schedule it for a weekly check but i'm using the default daily checks and every day from now it will keep a check on my dependent xml and see if a version can be implemented or not so daily your your your courage is if you are actually enabling different wordpress it's a sample project i can do that but i won't say do it for every project so let's go to other uh amazing github actions that can help a maintainer's life so it's not easy to stay always on pull request in the actions tab and not work at all maintainers also have work to do so instead of sitting on a laptop and staring at your screen at all the time you can create a notification center you can use github actions to trigger events and notify them inside your uh basically messaging applications like discord and slack i'll have to open discord to show this in action as well and before i create this creative action if you want to uh really know who is the creator of this action from the community you can see the user's tag as you see santosh the first name that you see is the tag of the person who is created is so you just copy it you go to github slash the name of the first created actions and you can go ahead and thank them for the negative actions that you're using so this is how community works you learn and grow with the community so to create a discord messenger github actions i'll go to my discord my friends are playing so i'm a little jealous with them [Music] so you go inside a server so i've created a noise card spanner so it's my gaming name please ignore this uh with all seriousness so inside your server go into a channel where you want your bot from github actions to send messages and click on edit channel inside that you will see integrations tab what you will do now is create a webhook and our default name is given i don't mind that you can add your image as well but i'm going to leave that and your credentials that you have to store it in github so that your github is only authenticated to your discord application you have to copy this web url correct after that you have to go to your settings tab once you are here go to secrets you will have to create two secrets and i'm going to share these because uh i do not have a knack for discord you can uh copy them but i'll go to book id so there is a pattern to this url web qr that i've copied this is the discord url of the api that they're using after the slash before the next slash is the github let's go back and create another repository secret that is web token and the web of token is everything that remains after this slash so you have created the webhook id and the webhook token now you can create your github actions and it will send the messages that you want to your so you to your discord application so i'm gonna quickly copy this code and go to actions create a new action i see two pull requests and hopefully my dependable is working it is failing so it is what it is because my docker of ci is failing for some issues i don't know why all right let's let's go let's ignore depend what as we do definitely so uh what i was on i was going to create a discord github actions i go into a new uh let's create why i'm on scholar right now this is me uh extremely nervous right now create a new workflow set up a book for yourself this time i remember to rename this so let's say discord vial your name is discord messenger so it will basically uh be on the actions tab i'm going to send everything on push and pull request on the default branch that is the main branch and it will require my web book id and web book that i've already stored the secrets it will use the username noise again my github tag oh sorry my gaming tag and it will send the message so the event that has triggered it will come inside your discord application so this is not a meaningful name but you can create meaningful uh messages like uh this github author has created this event at this specific time with this commit hash and you can play around this and it would be pretty easy to do uh but for the demonstration's sake let's create this bit of actions and see it in work let's go here so unlike multiple ci platforms available that are alternative for github actions data actions allows us to freely use parallel actions so there are multiple actions running simultaneously rather than waiting me waiting for one action to complete and followed by the next one so that is why github action is something again i got a notification in my discord which means this is working if i go into actions and i have received this so a board says push even triggered this message from github so that's how is it easy it was to connect your uh github actions to your discord another uh famous application which is more official more uh tech companies use slack than discord obviously so let's create uh github action for slack as well uh creating uh finding the token is a little difficult not that difficult but it is very easy in discord to create a slack token you have to go to their website or slack api i already have it bookmarked here you can create a new application and i'm going to create it from scratch uh let's give it a meaningful name let's say it's github bot and i've created a test uh workspace in slack called again my gaming name uh don't mind that and i'll to install this uh bot application that you have created here into your slack workspace you will have to go into the app home and specify some scopes here uh let's review some scopes to add uh then there is a bot access bot token scopes you can add over scope we want to write messages that is chat right right so every time github actions work this bot writes to our channels once you add a scope you must get a token where is that token i do not see it what token scope and about to connect it so it says it's it definitely comes on the top of the screen but it did not was some weird reason right now probably some new release no i just tested it in the morning so they boost on friday let's create create a new application again i'll go i'm going to do this quickly let's take gibberish let's hope let's hope doing something stupid work and i'm going to go an app home again let's do this again let's add a red url as well i'm going to type in my github name.com again it's going to be chat right hopefully i get my token somewhere am i sleeping are you also not seeing this i know i mean it says a token has been created but not sure where it is so bought token scope and and then auto can use our token exactly go to app home this is what it says automatically generated yeah so you can see it says token for your workspace has been generated these are the tokens probably you can click on that okay no no no i think i if i click on install to workspace then i would see it if i'm correct okay let's install this on the workspace oh my god so i'm going to copy this and i'm not going to lose this again i'll go to my slack here uh let's go to noise and you will see this application is here and it is not name that it should be but i want to add this in the general uh channel okay so i'll go to this and i'm going to settings i i don't see it here for via drawing probably you have to click add apps and then it will be available thanks a lot i'm really feeling sleepy so this board is added into the channel and it has right access as we created it so we move to github actions again finally and create this actions copy this code let's close some tabs which are unnecessary move to actions again create a new workflow i'm going to rename it first so that we don't get an issue and now we're going to we are going to see uh the name again just a quick check uh it's called slackchat messenger uh it will run on push and pull request onto the default branch it will be running using the ubuntu latest machine and it requires a setting called slackbot token which i forgot so i think it's good that i saw the code first before committing it directly let's go to the secrets tab new repository secret and well slack bought open it is and wow i think it's not lost yet yes [Music] finally we are able to create this token uh move ahead back here and i hope everything is fine once this runs i think i should see hi this is the test board in my slack let's close the tabs and wait inside here on the slack and wait any questions uh till then i know it's so it's absolutely fine i think there are no questions so far chat messenger i got a notification in discord so the actions worked again i'll wait for the slack thing to do it says it has built successfully and we get the message by this is the test watch from github by using a github actions so you can create a meaningful message as well it is extremely cool so apart from that uh the only thing that's left we are already a lot ahead of the time but one final actions that i would like to uh share is something that i really came across today but i love it a lot so synthos you know if i go on to my github profile this is something that everyone uh this feature is something everyone uses that is a profile read me right you can if someone visits your profile you you can tell them what you are and about yourself right but uh there was always a h inside me to uh show the github skyline right oh uh skyline i don't know yeah skyland.com i just checked it out yesterday but i don't know why it's not here so basically right so i wanted to incorporate this skyline inside my file with me right but i was unable to because it's it creates a 3d image in a dot stl format and you for right now at least you cannot incorporate directly in your profile read me so i went to my friends in the community tested it out and it's giving a sound that i just got afraid of so i went to the community and once again this is the creator of this repository i'm going to just check it out this person created an amazing uh github actions which allows you to add different plugins inside your profile readme called a metrics repository right and you can add your account details your organization details your isometric commit calendar but i finally found the skyline feature here that is this and i fell in love with this i i want to incorporate that but i just came across it today i'll hopefully do that but apart from it uh i'm going to copy this basically uh this is another uh plugin that he created what this does is it gives you a list of everything that you have done the number of comments you have created the number of pull requests the number of issues you have created in a dot svg format which is an image format and you can directly uh copy that to your github uh to your profile with me that's cool so i'm going to go here and create the final action of the day go to new workflow replace this and call it metric. i hope my github token is already here uh one thing new that you can see this github actions will not get triggered by events like pull push and release it will get triggered by a schedule so basically in the world of linux or star next there's a tool called cron and it allows you to schedule your jobs right and it follows a star mechanism and as it is already giving you a read description basically when specified which are day time and month you want this actions to run so zero means i guess every r at the zeroth minute i think i'm right basically i'm a little busy with my mind so hopefully uh user is basically the user name it is a user tag uh it's my tag right now it will create a metric.svg file inside the repository when it runs and it will take a little time to run so while it is working i'm done with the presentations so we can take up the qa before we see the results of the metrics if you have any questions okay uh probably andrag had one question but uh lars already answered this so uh it was related to the uh running github actions locally so uh basically all the github actions i have demonstrated today run inside run on github's remote servers using dockers right as i told about dockers so obviously you can test this out entirely locally i i do not remember the name correctly but yeah this is what input name equals to correct but uh there was another repository that i came across called uh i don't remember it started with n and it was called act so it allowed us to run github actions locally let's search for it because i'm also interested in that now yes it was nectar so i was remembering nectar so this is a repository that allows you to run your github actions locally and it is a very famous repository which means it is a good thing so if you if you want to test your actions locally uh check this out check this repository out it allows you to run all the github actions locally before creating them on the gita platform itself no it's cool so it has run successfully and as i said after turning successfully it will create a metric.svg file so let's go here and i think it's called github github hyphen metrics or svg file and if you see it it will tell you about your your uh entire journey on journey on github so this is the this is the svg file right i'm going to copy this file name so this is the readme of your repository i'm going to copy this here but you can obviously create this and your profile lead me as well so we are using markdown right here so people who are unaware about markdown colon sorry it's exclamation marks basically uh whatever link you're going to pass in here it will create an image out of it if i preview it uh you can see the svg file comes here you can center and land it if you want to uh and now if you go to the readme file you see this coming this metrics coming as your readme file you can move it to your profile let me and it will be this is nice so that's all from today and thank you again santosh for having me yeah thanks a lot uh thanks a lot nishkaj for joining and showing us those amazing community uh created killer factions i mean uh communities what actually making github actions amazing i would say because uh the way uh the community is treating github actions right i mean they are getting getting involved uh creating more github actions every day making it available for free i i think it is just pushing the uh maintainers i mean they are of course saving a lot of time to the uh open source maintainers which are there so thanks a lot to all the developers who are actually creating github actions and making it available correct i mean all the credits to them and if you want to check out all the repositories uh and all the actions that i've tested out as i mentioned there are inside my links and those will add the repository link into the description of the youtube and you can check them out and uh thanks them by giving a star on their repositories yeah sure and uh okay so uh apart from this would you like to promote anything discussion on the channel uh i do not want to do a cheap plugin here but i do want to talk about github stars platform as you mentioned in the beginning and everyone is a star for me everyone uh in the community is a star for me i am no one no special person that i'm a github star uh because if i tell you truthfully i'm i'm 22 years old i'm just going to pass out next month i'm still not graduated yet but i i just do things that everyone can basically if i talk about my journey till now is i've been working on github since 2018 but in 2019 i was inspired by people uh on linkedin and twitter so people were trying to learn and share their knowledge the knowledge here is extremely important and they were doing that by performing a challenge called hashtag 100 days of code so they were learning every day and sharing that in a public repository on github and tweeting about it or sharing it as a linkedin post and i thought why not i cannot do it as i said initially uh the first step that you take uh to learn something even if you fail uh it beats the weakness out of you you should beat the weakness out of you once you achieve the first step the all the steps are extremely easy so i started i failed a lot in initially but after that i learned a lot as well in the field of devops i learned end-to-end pipelines and whatnot and after that i started promoting uh open source practices so i'm going to talk about as you said if you want to have a promotions or sort i love my college my university of ups that is university of petroleum and energy studies in daradun they are a huge promoter of open source so basically uh my teachers my faculty mr monik kapoor and many others created a community called the open community which has the first asian community to sign up with the linux foundation and we were able to promote uh open source and talk about github a lot so i myself uh hosted a lot of meetups promoting that to the students we even alongside my teachers help created a movement on twitter called hashtag hundred days of code at ups that is our college and people uh many students around 800 or 900 students of us started learning and contributing a lot after that i also started uh taking parts in community events like hacktoberfest that is digital ocean uh annual event and i also started speaking in different conferences like the confederate conference and the github satellite event so everything that i did is was nothing special if anyone can do it helping others is extremely important and i'm extremely grateful to get up to uh actually think that i will start agreeing so that's that's amazing to know so i thought you are working somewhere so you mentioned it principal devops eventually i'm actually also working so i took an early from a university i'm on a sales ready mode uh and i'm working as a principal devops evangelist at status league wow that's that's amazing i mean i was uh of course the era has changed right i mean when we went in college there was nothing so uh even the internet was growing and now it has it it is at an another level so that's amazing i mean now and happy to know about your university driving those initiatives to actually make uh sure that more developers are contributing open source so that's that's amazing thank you okay so lots yeah and uh thanks again uh nicholas for joining us so in case they so in case anybody anyone has question where they can reach out nishkish definitely i mean the description of the youtube repository and i would keep a check on the youtube and i will respond as many as i can okay cool that's uh great okay so uh thanks a lot again everyone for joining us today and uh uh amazing github actions which i saw because i was even not aware of those so uh thanks again for presenting those nishkas and on closing notes we are going to meet again next week so next week we have two episodes coming up one is uh on 15th 15th june where we will have one of the team members from julia lang i'm sure you are aware of that language so we are going to talk more about julia lang and then we will again meet on friday let me check so just a and yeah so uh next friday next friday we have minko minko getcha who works at google uh in angular team so he is one of the uh dev advocate for angular angular so we will be talking about writing compiler so in case you are interested to learn how to write your own compiler feel free to join us minko will be talking about it and then that's it so see you uh next tuesday and thanks again bye bye good night everyone bye bye bye everyone thanks for
Info
Channel: Tech Talks With Santosh
Views: 129
Rating: undefined out of 5
Keywords:
Id: jE_wksfN2Og
Channel Id: undefined
Length: 73min 7sec (4387 seconds)
Published: Fri Jun 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.