>> Did you know there's a simple way to automate
the deployment of your code from GitHub to Azure?
Gopi is here to show us how to use GitHub Actions to deploy
your solutions directly to Azure today on Azure Friday.
[MUSIC]
Hey everyone, Donovan Brown here with
another episode of Azure Friday.
I'm here with Gopi and we're going to be learning about how to use
GitHub Actions to deploy to Azure.
So, what actually is a GitHub Action?
>> GitHub Actions helps you automate
any workflow from developer perspective,
taking your code and then creating a full request to based on
the full requests that trigger
an event and then do something that you want,
or as a new issue that got created,
you want to do something with the code again,
or there is a label that you added to your comment,
you want to do some actions.
Essentially, it is any workflow management.
>> Got you. So there's lots of different ways I can
trigger one of these GitHub Actions
and then there's just task I assume that
you run inside your action to get things done.
>> Right.
>> All right, cool.
>> That's what they call it as the actions and the cool thing is,
all of these actions are actually
running inside a Container image.
>> Interesting. Okay, great.
So where do I go to get these actions?
How do I know what actions are available to me?
>> Right. So I'm in
my GitHub repo and then inside the GitHub repo,
you can actually see the actions that are available for me.
>> So this is available on anyone's GitHub repository.
There's a tab for actions,
you just go in there and configure them.
>> Correct.
>> Got it.
>> Configure them. So I have my code,
this is a simple application where I actually
and already configured it but I'll just show you how do I edit?
How do a grow up this experience?
Like now, I just recorded the main workflow.
If I just switched to my branch,
you can actually just see that there'll be two ways of editing it.
We see they have a visual way of editing it,
the GitHub Actions or you can actually edit file itself.
>> So, it is just like what a YAML file?
>> This is similar to YAML file.
But they're using specific format.
>> Format and different syntax.
>> Right.
>> Fair enough.
>> So I'll just to go here.
Again, I already have an application.
What I'm doing is,
I'm taking that application,
first log into your Docker registry
and then building the Container image,
tagging an image, and pushing to a Container registry.
But here is where the Azure part that comes.
>> Got it.
>> Now, the image that actually built in,
I want to take that image automatically,
login into Azure, create a web app for
Container dynamically and then deploy my application.
That's the workflow that is possible.
So one use case that you can think of is,
we are trying to do it as a push.
As a push or as a PR, you can configure it.
So as a push,
you want to dynamically create an environment,
deploy your application and then test it
if needed and then destroy it once it is discarded.
I've not quoted the destroy part here.
But every push, it actually takes
your application automatically, is deploying it,
now you can give it for UAT testing,
or you can play with your application without you doing anything.
>> So how did you add the task.
Is there like a task library or something here?
>> Right. So now,
if I want to add a task,
I just need to drag in the VisualEditor.
You can see that it actually pops up the featured actions that are
available like they have
actions available for pretty much every Cloud,
AWS, Google, now if I just search for Azure.
You will find Azure Clouds.
Azure task that are available.
I can just show you how do we use it and
then where exactly they are available.
Now, if I add it,
it just ask me for Azure.
Now, I can just say perform pretty much
any AGC CLI command that I want to and I can view the argument.
>> I see. That's how you added all the ones that came beforehand.
>> That's how I added all the ones
and the key thing is, they have secrets.
The secrets are the values are not exposed.
They are just stored in a strict environment
where only they will be used
inside the Container image during the execution.
>> Got you. So above it,
l see you have a deploy app to a web app,
like can I deploy a functions and VMs and all that kind of stuff.
>> Yes.
>> How do I know what my targets are?
>> So the GitHub Action for Azure that I just added.
Let me just show you the source code and even
these actions that are available,
you can see the first CLI.
It is just to tell you the exact usage.
You can manage as I've just shown you,
you can add it through the VisualEditor
or you can paste this snippet into
the code that the YAML code
that's there and then just to define the required environment.
Variables that are needed are the secrets then you are set.
You find just to bubble up to the GitHub actions repo,
you can actually see multiple actions that we have built it.
For each of these,
we actually have the code that is available right here.
It's all about the Docker file,
which Docker image that I need to use and then
what exactly needs to be done inside it.
>> Got it. So you can go back up one a little again.
So I see there's AKS in there, I see the CLI.
I can run an arm templates.
I can do pipelines, functions.
I got it. Okay. So this is where,
I'm assuming this is going to continue to grow with
additional targets and additional ways to deploy into GitHub,
I mean to Azure from GitHub.
>> Yeah, exactly. So this is actually are now available
in the OSS like everybody pretty much has an access.
You can continue to submit PR
for every specific thing that you have here and I want to add
a Cosmos DB deployment and I want to add Azure SQL deployment.
I think you can just submit
the PR as we already look at it and take it forward.
>> Right. So we are accepting PRs for
this particular repository to
add additional actions to GitHub Actions.
>> Yes.
>> Awesome. Well, this is really cool.
It's got a really easy way to get started
with getting your code deployed using just GitHub Actions.
You don't need anything other than GitHub
to get into Azure which is really nice to know.
Thank you so much. So we're learning all about using
GitHub actions to get to Azure here on Azure Friday.
[MUSIC]