You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. In the new tab, follow the prompts to create a new repository.
48
+
2. In the new tab, most of the prompts will automatically fill in for you.
37
49
- For owner, choose your personal account or an organization to host the repository.
38
-
- We recommend creating a public repository—private repositories will [use Actions minutes](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions).
39
-

40
-
3. After your new repository is created, wait about 1 minute, then refresh the page. Follow the step-by-step instructions in the new repository's README.
50
+
- We recommend creating a public repository, as private repositories will [use Actions minutes](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions).
51
+
- Scroll down and click the **Create repository** button at the bottom of the form.
52
+
3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
41
53
42
54
</details>
43
55
@@ -61,7 +73,7 @@ We'll use labels as triggers for multiple tasks:
61
73
At the start of each workflow run, GitHub automatically creates a unique `GITHUB_TOKEN` secret to use in your workflow. We need to make sure this token has the permissions required for this course.
62
74
63
75
1. Open a new browser tab, and work on the steps in your second tab while you read the instructions in this tab.
64
-
1. Go to Settings > Actions > General. Ensure that the `GITHUB_TOKEN` also has **Read and write permissions** enabled under **Workflow permissions**. This is required for your workflow to be able to upload your image to the container registry.
76
+
1. Go to Settings > Actions > General. Ensure that the `GITHUB_TOKEN` also has **Read and write permissions** enabled under **Workflow permissions**. This is required for your workflow to be able to upload your image to the container registry.
65
77
66
78
### :keyboard: Activity 2: Configure a trigger based on labels
67
79
For now, we'll focus on staging. We'll spin up and destroy our environment in a later step.
@@ -99,7 +111,7 @@ For now, we'll focus on staging. We'll spin up and destroy our environment in a
99
111
100
112
_Good job getting started :gear:_
101
113
102
-
### Nice work triggering a job on specific labels
114
+
### Nice work triggering a job on specific labels
103
115
104
116
We won't be going into detail on the steps of this workflow, but it would be a good idea to become familiar with the actions we're using. They are:
105
117
@@ -139,15 +151,15 @@ We won't be going into detail on the steps of this workflow, but it would be a g
139
151
}
140
152
]
141
153
```
142
-
1. In your terminal, run the command below.
154
+
1. In your terminal, run the command below.
143
155
```shell
144
156
az ad sp create-for-rbac --name "GitHub-Actions" --role contributor \
145
157
--scopes /subscriptions/{subscription-id} \
146
158
--sdk-auth
147
159
148
160
# Replace {subscription-id} with the same id stored in AZURE_SUBSCRIPTION_ID.
149
-
```
150
-
> **Note**: The `\` character works as a line break on Unix based systems. If you are on a Windows based system the `\` character will cause this command to fail. Place this command on a single line if you are using Windows.**
161
+
```
162
+
> **Note**: The `\` character works as a line break on Unix based systems. If you are on a Windows based system the `\` character will cause this command to fail. Place this command on a single line if you are using Windows.**
151
163
7. Copy the entire contents of the command's response, we'll call this `AZURE_CREDENTIALS`. Here's an example of what it looks like:
152
164
```shell
153
165
{
@@ -306,8 +318,8 @@ Personal access tokens (PATs) are an alternative to using passwords for authenti
306
318
307
319
To deploy successfully to our Azure environment:
308
320
309
-
1. Create a new branch called `azure-configuration` by clicking on the branch dropdown on the top, left hand corner of the `Code` tab on your repository page.
310
-
2. Once you're in the new `azure-configuration` branch, go into the `.github/workflows` directory and create a new file titled `spinup-destroy.yml` by clicking **Add file**.
321
+
1. Create a new branch called `azure-configuration` by clicking on the branch dropdown on the top, left hand corner of the `Code` tab on your repository page.
322
+
2. Once you're in the new `azure-configuration` branch, go into the `.github/workflows` directory and create a new file titled `spinup-destroy.yml` by clicking **Add file**.
311
323
312
324
<details>
313
325
<summary>Copy and paste the following into this new file:</summary>
@@ -383,10 +395,10 @@ To deploy successfully to our Azure environment:
383
395
```
384
396
</details>
385
397
386
-
3. Click **Commit changes...** and select `Commit directly to the azure-configuration branch.` before clicking **Commit changes**.
387
-
4. Go to the Pull requests tab of the repository.
388
-
5. There should be a yellow banner with the `azure-configuration` branch where you can click **Compare & pull request**.
389
-
6. Set the title of the Pull request to: `Added spinup-destroy.yml workflow`and click `Create pull request`.
398
+
3. Click **Commit changes...** and select `Commit directly to the azure-configuration branch.` before clicking **Commit changes**.
399
+
4. Go to the Pull requests tab of the repository.
400
+
5. There should be a yellow banner with the `azure-configuration` branch where you can click **Compare & pull request**.
401
+
6. Set the title of the Pull request to: `Added spinup-destroy.yml workflow`and click `Create pull request`.
390
402
391
403
We will cover the key functionality below and then put the workflow to use by applying a label to the pull request.
392
404
@@ -429,16 +441,16 @@ _Nicely done, you used a workflow to spin up your Azure environment :dancer:_
429
441
430
442
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!
431
443
432
-
1. Create a new branch named `staging-test` from `main` using the same steps as you did for the previous `azure-configuration` branch.
433
-
1. Edit the `.github/workflows/deploy-staging.yml` file, and replace every `<username>` with your GitHub username.
444
+
1. Create a new branch named `staging-test` from `main` using the same steps as you did for the previous `azure-configuration` branch.
445
+
1. Edit the `.github/workflows/deploy-staging.yml` file, and replace every `<username>` with your GitHub username.
434
446
1. Commit that change to the new `staging-test` branch.
435
-
1. 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`.
447
+
1. 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`.
436
448
437
449
### :keyboard: Activity 1: Add the proper label to your pull request
438
450
439
451
1. Ensure that the `GITHUB_TOKEN` for this repository has read and write permissions under **Workflow permissions**. [Learn more](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token). This is required for your workflow to be able to upload your image to the container registry.
440
452
1. Create and apply the `stage` label to your open pull request
441
-
1. 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!
453
+
1. 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!
442
454
1. Once the workflow has completed, refresh this page for the next step.
443
455
444
456
</details>
@@ -559,7 +571,7 @@ Copy and paste the following to your file, and replace any `<username>` placehol
559
571
az cache purge
560
572
az account clear
561
573
```
562
-
1. Update every `<username>` to your GitHub username.
574
+
1. Update every `<username>` to your GitHub username.
563
575
1. Commit your changes to the `production-deployment-workflow` branch.
564
576
1. Go to the Pull requests tab and click **Compare & pull request** for the `production-deployment-workflow` branch and create a Pull request.
0 commit comments