Leon Welicki: Hello there and thank you very much for
joining us today in this new Azure Portal How To video.
Today, we learn how to deploy to your web app using GitHub
Actions. And for that, we have Jason Freeberg,
who's going to show us how to do that.
So, thank you very much for joining us, Jason.
Jason Freeberg: Yeah, thanks, Leon.
So today, we're going to be talking about how to use
GitHub Actions to deploy to your web app.
GitHub Actions, for those that aren't familiar, is a
workflow automation utility that has CICD built right in.
So, this means a GitHub user can trigger a workflow run if
there's a new commit, a new pull request, or a new branch
is created.
So, let's go ahead and jump into the portal.
So here, we're looking at my web app and this is a Java 8
application and it's running on P1 V2.
So, I'll jump into the Deployment Center on the left.
And here, I have options for Azure repos, GitHub, and
Bitbucket. We're talking about GitHub Actions,
so I'll jump into GitHub and hit continue.
Now on this screen, we have a new option for GitHub
Actions, so I'll select that.
And now on this next screen, I'm going to select my
repository.
So, I'm going to select my username.
And then my Spring application that I'm going to deploy.
Here, I'm going to deploy my master branch; it could be
any branch, but I'll choose master.
And then here, I'm using Java 8.
And since I'm deploying a Spring Boot application, I'm
going to choose Java SE.
If I was deploying a Tomcat application, I could choose
one of these Tomcat versions.
And so now on this last screen, we have a summary of my
selections here, so I could go back and edit.
And at the bottom, we're looking at a preview of the
workflow file that will be committed into my repository.
So if we take a quick look here, this will run anytime
that there's a push on the master branch.
This will check out the master branch of my repo, set up
my Java version to Java 8.
It'll build my Spring app using Maven.
And then finally, using the deployment action, it will
grab that jar file and then deploy it onto my web app.
So when I click finish here, this will start the process
to commit it into my repository and let's go ahead and
jump into my repo using this link right here.
So, there's a new directory in my GitHub repo,
.github/workflows.
So, as you might guess, this is where all of my
workflows would be.
Right now, I only have the one that was just added.
And if we take a look at the file, it matches the one that
was shown in the preview just a minute ago.
So, what I'll do now is come up to the top toolbar here,
select Actions.
And this shows me all of my previous workflow runs and on
the left hand side, it shows me all of my different
workflow files.
Now in this case, I only have the one, so I'll select this
workflow file right here.
And we can see that that deployment action is running
right now.
So if we click this and I come over to build and deploy
on the left, here I can find all of my different steps of
that workflow.
And I can even search my logs.
So here, we're looking at the progress of the maven build.
And then this is the output of the web apps deploy action.
So if I search through some query terms here, we'll see
that that shows up just fine.
So, actually, just now the workflow completed running.
So, let's jump back to the portal here.
And you can see in the dashboard that's reflected here
that the success of the workflow is right there and it's
running right now.
So, let's browse to the application.
And perfect, there we go.
So, it's my Spring Boot app running on my web app and I
deployed it with GitHub Actions.
Leon: That's great. Thank you very much, Jason.
This looks awesome.
Jason: Yeah. Leon: Thanks every one of you.
Please try this out and let us know what you think.
Follow us on Twitter.
Leave us a comment in the comments section and look
forward to seeing you in the next video.
Thanks for watching.