Deploy to Azure
Create two deployment workflows using GitHub Actions and Microsoft Azure.
Step 4: Deploy to a staging environment based on labels
Nicely done, you used a workflow to spin up your Azure environment 💃
Now that the proper configuration and workflow files are present, let's test our actions! In this step, there's a small change to the game. Once you add the appropriate label to your pull request, you should be able to see the deployment!
- Create a new branch named
staging-test
frommain
using the same steps as you did for the previousazure-configuration
branch. - Edit the
.github/workflows/deploy-staging.yml
file, and replace every<username>
with your GitHub username. - Commit that change to the new
staging-test
branch. - Go to the Pull requests tab and there should be a yellow banner with the
staging-test
branch toCompare & pull request
. Once the pull request is opened up, clickCreate pull request
.
⌨️ Activity 1: Add the proper label to your pull request
- Ensure that the
GITHUB_TOKEN
for this repository has read and write permissions under Workflow permissions. Learn more. This is required for your workflow to be able to upload your image to the container registry. - Create and apply the
stage
label to your open pull request - Wait for the GitHub Actions workflow to run and deploy the application to your Azure environment. You can follow along in the Actions tab or in the pull request merge box. The deployment may take a few moments but you've done the right thing. Once the deployment is successful, you'll see green check marks for each run, and you'll see a URL for your deployment. Play the game!
- Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.
Get help: Post in our discussion board • Review the GitHub status page
© 2023 GitHub • Code of Conduct • MIT License