There's only one place to start when you're learning a new technology. In this video, get an introduction to actions by creating "Hello, World!".
- [Instructor] Let's jump right in and get started by running a workflow with an action that prints the phrase all new projects start with, hello world. I've created a new repository and I'll start by clicking the actions tab. I haven't created any workflows in this repository yet so on this page we some examples we can use to get started with actions. I'll click the set up this workflow button under the example named simple workflow. On the workflow screen GitHub has filled out a sample workflow for us. At the top, we can see the name of the workflow file blank.yml To keep the file name in line with this example I'll change the name to hello.yml The rest of the text I'm going to leave the same. If we scan the file we can see the workflow defines a job named build, it lists the platform the job will run on, and then under the steps keyword it lists the actions the job will run to print our hello world message. We'll review all of these settings in more detail soon but for now let's get this workflow running. To do that I'll click this lovely green button labeled start commit and then I'll click commit new file. This writes the file to the repository and creates a push event that starts the workflow. Now let's click the actions tab to see the results. Okay, things look a little bit different this time. We can see that our hello workflow has been defined and was also triggered when we push the file into the repo. We can also see that our workflow has been cued to run and has finished. This green check mark is a good sign that everything went well but lets click into the workflow to see the results. Next to the green check mark I'll click ci. On this page we can see a log of the jobs that ran and our workflow and steps that were taken by each job. Each step has a green check mark next to it which is another indicator that everything was run according to plan. The output from the steps is hidden so we'll need to click the arrow next to the steps description to see it. The main steps we're interested in are the ones where the job ran a one line script and a multi-line script. So I'll click the arrow next to those and there's our output. We can see our hello world message and another message inviting us to add other actions to build, test, and deploy our project. I think that's a great idea but before we do that let's go over some of the attributes that we'll be using as we create workflows and actions.
- Creating an action
- Creating a workflow
- Adding actions to a workflow
- Using an action from a repository
- Developing a CI/CD pipeline with GitHub Actions
- Building custom actions
- Publishing an action to the GitHub Marketplace