Skip to content

amit-thapa/skills-deploy-to-azure

Repository files navigation

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!

  1. Create a new branch named staging-test from main using the same steps as you did for the previous azure-configuration branch.
  2. Edit the .github/workflows/deploy-staging.yml file, and replace every <username> with your GitHub username.
  3. Commit that change to the new staging-test branch.
  4. Go to the Pull requests tab and there should be a yellow banner with the staging-test branch to Compare & pull request. Once the pull request is opened up, click Create pull request.

⌨️ Activity 1: Add the proper label to your pull request

  1. 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.
  2. Create and apply the stage label to your open pull request
  3. 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!
  4. 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 boardReview the GitHub status page

© 2023 GitHub • Code of ConductMIT License