1 00:00:00,000 --> 00:00:03,300 NARRATOR: Automation is key for streamlining your work processes 2 00:00:03,300 --> 00:00:06,900 and GitHub Actions is the best way to supercharge your GitHub Workflow. 3 00:00:06,900 --> 00:00:08,250 This enables you to create 4 00:00:08,250 --> 00:00:13,200 custom software development life cycle workflows directly in your GitHub repository. 5 00:00:13,200 --> 00:00:16,080 GitHub Actions is fully integrated into GitHub. 6 00:00:16,080 --> 00:00:18,840 It's built-in from the merge box to the checks tab, 7 00:00:18,840 --> 00:00:20,430 from the UI to the API. 8 00:00:20,430 --> 00:00:22,605 It works the way that GitHub works. 9 00:00:22,605 --> 00:00:26,280 Since GitHub Actions help you automate your software development workflows in 10 00:00:26,280 --> 00:00:30,340 the same place you store code and collaborate on pull requests and issues, 11 00:00:30,340 --> 00:00:31,860 you can discover, create, 12 00:00:31,860 --> 00:00:35,205 and share actions to perform essentially any job that you'd like, 13 00:00:35,205 --> 00:00:36,855 including CI and CD, 14 00:00:36,855 --> 00:00:40,185 and then combine actions in a completely customized workflow. 15 00:00:40,185 --> 00:00:42,360 To visualize how this can be useful, 16 00:00:42,360 --> 00:00:44,925 let's take a quick look at the basic GitHub Flow, 17 00:00:44,925 --> 00:00:49,020 a lightweight yet effective branch-based workflow commonly used on GitHub, 18 00:00:49,020 --> 00:00:51,030 and then see how GitHub Actions fits in. 19 00:00:51,030 --> 00:00:54,205 Now, when we want to make changes to our code in our GitHub Repository, 20 00:00:54,205 --> 00:00:57,505 we branch off of main or the production branch, maker commits, 21 00:00:57,505 --> 00:01:00,430 open up a pull request on GitHub to share our changes, 22 00:01:00,430 --> 00:01:04,570 and then merge this branch into the main branch and then delete our feature branch. 23 00:01:04,570 --> 00:01:06,040 Looking at the GitHub Flow, 24 00:01:06,040 --> 00:01:08,890 where would this automation with GitHub Actions take place? 25 00:01:08,890 --> 00:01:11,785 Well, the great thing about GitHub Actions is that you can apply 26 00:01:11,785 --> 00:01:13,840 existing GitHub Actions or even create 27 00:01:13,840 --> 00:01:17,245 your own GitHub Actions to essentially any stage in the GitHub Flow. 28 00:01:17,245 --> 00:01:19,030 Do you want to include CICD? 29 00:01:19,030 --> 00:01:20,635 Well, GitHub Actions can do that. 30 00:01:20,635 --> 00:01:23,050 Do you want a specific automated tasks to run 31 00:01:23,050 --> 00:01:25,450 when an issue is opened, labeled, or closed? 32 00:01:25,450 --> 00:01:28,900 How about when a pull request is opened and you want automated reminders 33 00:01:28,900 --> 00:01:32,545 created based on labels or reviewers from a code owners file? 34 00:01:32,545 --> 00:01:34,450 Well, GitHub Actions enables you to create 35 00:01:34,450 --> 00:01:37,315 these custom software development life cycle workflows 36 00:01:37,315 --> 00:01:39,250 directly in your GitHub repository. 37 00:01:39,250 --> 00:01:41,155 GitHub Actions are event-driven, 38 00:01:41,155 --> 00:01:45,205 meaning that you can run a series of commands after a specified event has occurred. 39 00:01:45,205 --> 00:01:48,865 For example, every time someone creates a pull request for a repository, 40 00:01:48,865 --> 00:01:52,495 you can automatically run a command that executes a software testing script. 41 00:01:52,495 --> 00:01:55,820 Instead of using CI or CD integrations, with GitHub Actions, 42 00:01:55,820 --> 00:01:58,710 you can build end-to-end CI and CD capabilities, 43 00:01:58,710 --> 00:02:00,360 and yes, you probably guessed it, 44 00:02:00,360 --> 00:02:02,380 directly in your GitHub Repository. 45 00:02:02,380 --> 00:02:05,420 This gives you the ultimate freedom to customize how your actions 46 00:02:05,420 --> 00:02:09,110 work and automate tasks all along your software development life cycle. 47 00:02:09,110 --> 00:02:11,930 Now that we can see where we can apply automation 48 00:02:11,930 --> 00:02:14,870 using GitHub Actions within our software development workflow, 49 00:02:14,870 --> 00:02:18,245 let's take a closer look into how GitHub Actions actually work. 50 00:02:18,245 --> 00:02:22,565 GitHub Actions use YAML syntax to define the events, jobs, and steps. 51 00:02:22,565 --> 00:02:24,170 These YAML files are stored in 52 00:02:24,170 --> 00:02:28,185 your code repository in a directory called .github/workflows. 53 00:02:28,185 --> 00:02:31,715 An event automatically triggers the workflow which contains a job. 54 00:02:31,715 --> 00:02:35,255 The job then uses steps to control the order in which actions are run. 55 00:02:35,255 --> 00:02:38,555 These actions are the commands that automate your software testing. 56 00:02:38,555 --> 00:02:40,010 In this example workflow, 57 00:02:40,010 --> 00:02:43,595 it automatically triggers a series of commands whenever code is pushed. 58 00:02:43,595 --> 00:02:47,675 GitHub Actions checks out the pushed code, installs the software dependencies, 59 00:02:47,675 --> 00:02:51,035 and runs bats-v to output the software version. 60 00:02:51,035 --> 00:02:53,435 With GitHub Actions, you can also build, test, 61 00:02:53,435 --> 00:02:56,360 and publish across multiple operating systems, 62 00:02:56,360 --> 00:02:59,200 platforms, and languages all within the same workflow, 63 00:02:59,200 --> 00:03:02,735 and then see the status checks displayed within your pull request. 64 00:03:02,735 --> 00:03:03,770 With GitHub Actions, 65 00:03:03,770 --> 00:03:06,620 you have the ability to create your own actions or leverage 66 00:03:06,620 --> 00:03:10,670 these pre-built actions by the community found on the GitHub marketplace. 67 00:03:10,670 --> 00:03:14,850 So if you've been itching to customize and automate your workflow from idea to production, 68 00:03:14,850 --> 00:03:16,950 jump into GitHub Actions today and explore 69 00:03:16,950 --> 00:03:20,830 the amazing community actions in the GitHub marketplace