1 00:00:01,870 --> 00:00:03,760 Our digital ocean clutter is up and running. 2 00:00:03,790 --> 00:00:04,690 We can connect to it. 3 00:00:04,720 --> 00:00:06,970 And now it's time to start to deploy our application to it. 4 00:00:07,480 --> 00:00:11,680 Let me show you a diagram very quickly that's going to outline how we are going to use a GitHub action 5 00:00:11,680 --> 00:00:16,060 at workflow to automatically deploy all of our different services to this running cluster. 6 00:00:16,780 --> 00:00:16,990 OK. 7 00:00:17,050 --> 00:00:19,540 So the first time we look at this diagram is give me a little bit confusing. 8 00:00:19,570 --> 00:00:20,740 So let me walk you through it. 9 00:00:21,490 --> 00:00:23,290 Each of these vertical series right here. 10 00:00:23,350 --> 00:00:25,480 So we've got one vertical series right there. 11 00:00:25,750 --> 00:00:26,560 Another one right there. 12 00:00:26,590 --> 00:00:27,160 And so on. 13 00:00:27,460 --> 00:00:32,230 Represents a different workflow file that we're going to put together, essentially a separate GitHub 14 00:00:32,410 --> 00:00:32,920 action. 15 00:00:33,890 --> 00:00:37,130 So in total, we're going to have about seven different workflow files. 16 00:00:38,090 --> 00:00:42,470 In each of these different workflow files, we are going to have a little bit of configuration that's 17 00:00:42,470 --> 00:00:46,710 going to run any time that we merge a pull request into the master branch. 18 00:00:47,390 --> 00:00:52,460 Whenever we emerge a player request into the master branch, we're going to inspect each of our different 19 00:00:52,610 --> 00:00:53,300 services. 20 00:00:53,530 --> 00:00:56,000 So the auth service, client expiration and so on. 21 00:00:56,720 --> 00:01:02,060 And if anything changed inside of that service or specifically inside of our off folder, client folder, 22 00:01:02,060 --> 00:01:03,380 expiration folder and so on. 23 00:01:03,950 --> 00:01:07,250 Then we're going to go through the series of steps that you see on the right hand side. 24 00:01:09,000 --> 00:01:13,820 It's a long story short, just to repeat that one more time, because this is a confusing diagram every 25 00:01:13,820 --> 00:01:16,670 time that we merge a policy question to the master branch. 26 00:01:16,940 --> 00:01:19,790 We're going to see if anything changed inside of that auth directory. 27 00:01:20,150 --> 00:01:23,210 And if it did, we're going to go through this series of steps. 28 00:01:24,450 --> 00:01:29,100 So that series of steps, we're going to first take everything inside that auto directory and build 29 00:01:29,160 --> 00:01:30,240 a new image out of it. 30 00:01:30,410 --> 00:01:34,590 So that's a normal docker image similar to how we've done it many, many times in the past. 31 00:01:35,710 --> 00:01:38,710 We're then going to take that image and push it off to Docker Hub. 32 00:01:40,190 --> 00:01:42,740 After that, we're going to reach out to our running cluster. 33 00:01:43,040 --> 00:01:49,040 So our cluster on digital ocean and we're going to update our deployment or the off service and we're 34 00:01:49,040 --> 00:01:53,510 going to tell that deployment to use the newest version of the off image that is available. 35 00:01:53,570 --> 00:01:55,700 The one that we had just pushed off to Docker Hub. 36 00:01:58,350 --> 00:02:01,210 So that is it for each of our individual six services. 37 00:02:01,780 --> 00:02:06,460 The actual workflow files that they get, hub action files, are going to be almost identical in nature. 38 00:02:07,060 --> 00:02:11,020 The reason we are creating all these workflow files separately is just so we can make sure that we do 39 00:02:11,020 --> 00:02:15,460 not rebuild and deploy images if nothing has changed inside of a given service. 40 00:02:16,030 --> 00:02:20,440 In addition, this is also going to make it really easy for us to change the building process for a 41 00:02:20,440 --> 00:02:21,370 particular service. 42 00:02:21,610 --> 00:02:26,560 If we need to at some point time, for example, we might decide to rewrite the payment service using 43 00:02:26,590 --> 00:02:28,570 a different programming language at some point. 44 00:02:28,990 --> 00:02:33,010 And so we would want to make sure that we can very easily customize how that payment service gets built. 45 00:02:33,070 --> 00:02:37,030 At some point, and maybe we need to push it off to a different provider. 46 00:02:37,120 --> 00:02:37,690 Who knows? 47 00:02:38,870 --> 00:02:39,980 We can do that very easily. 48 00:02:40,010 --> 00:02:43,070 By creating a separate workflow for each of our different services. 49 00:02:45,100 --> 00:02:47,610 Maybe beyond each of our individual services, remember? 50 00:02:47,710 --> 00:02:52,750 We also have that set of Cuban Eddys config files, which is where we create all of our different actual 51 00:02:52,990 --> 00:02:55,690 services, where we define our ingress service. 52 00:02:55,930 --> 00:02:58,390 That's where we also define all the different deployments themselves. 53 00:02:59,080 --> 00:03:03,160 So as an additional workflow, in addition to all these other six that we're going to put together, 54 00:03:03,490 --> 00:03:07,640 we're gonna have one other workflow that is always going to be executed at all times. 55 00:03:09,430 --> 00:03:12,820 We're going to make sure that we reach in to that in Fred directory. 56 00:03:14,040 --> 00:03:17,880 And we're going to apply all the Yamal files inside there to our cluster. 57 00:03:18,300 --> 00:03:19,710 Remember that the infra directory. 58 00:03:20,720 --> 00:03:23,720 Right here is where all of our communities can pick Byles live. 59 00:03:24,560 --> 00:03:26,480 So if we make any change, these can take files. 60 00:03:26,570 --> 00:03:28,910 We're just going to reapply them to our cluster. 61 00:03:30,070 --> 00:03:30,400 That's it. 62 00:03:30,460 --> 00:03:31,360 That's the general plan. 63 00:03:33,280 --> 00:03:34,750 So in total, we're going have to create. 64 00:03:34,840 --> 00:03:37,510 Well, seven different config files. 65 00:03:38,570 --> 00:03:42,170 Now, we also thought you were really only good to great, too, at the end of the day, really just 66 00:03:42,170 --> 00:03:47,090 going to create the auth one and then pretty much copy paste it or client expiration and so on. 67 00:03:47,720 --> 00:03:50,400 And the only other one that we really have to write from scratch is infra. 68 00:03:51,140 --> 00:03:55,430 So although we do have to create several different files, we really only have to create two from scratch. 69 00:03:55,520 --> 00:03:58,760 And then from there on, it will really just be a job of copy paste. 70 00:03:59,740 --> 00:04:04,000 It's now that we understand the plan, because here we can start to implement this in just a moment.