Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit e621b5d

Browse files
authored
Merge pull request #38 from githubtraining/rename-branch
rename default branch in responses
2 parents 3570213 + 67d7cf6 commit e621b5d

8 files changed

+49
-28
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ For more information on the goals of this course, check out the [`course-details
1414

1515
## Contribute
1616

17-
See something we could improve? Check out the contributing guide in the [community contributors repository](https://github.com/githubtraining/community-contributors/blob/master/CONTRIBUTING.md) for more information on the types of contributions we :heart: and instructions.
17+
See something we could improve? Check out the contributing guide in the [community contributors repository](https://github.com/githubtraining/community-contributors/blob/main/CONTRIBUTING.md) for more information on the types of contributions we :heart: and instructions.
1818

19-
We :heart: our community and take great care to ensure it is fun, safe and rewarding. Please review our [Code of Conduct](https://github.com/githubtraining/community-contributors/blob/master/CODE_OF_CONDUCT.md) for community expectations and guidelines for reporting concerns.
19+
We :heart: our community and take great care to ensure it is fun, safe and rewarding. Please review our [Code of Conduct](https://github.com/githubtraining/community-contributors/blob/main/CODE_OF_CONDUCT.md) for community expectations and guidelines for reporting concerns.
2020

2121
## License
2222

Diff for: config.yml

+25-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ template:
1313

1414
# Before
1515
before:
16-
# Repository must have a master branch with the working code, and 4 other branches:
16+
# Repository must have a main branch with the working code, and 4 other branches:
1717
# staging-workflow: with the workflow file stub for staging from label
1818
# aws-configuration: with blank/stub files for `aws-config.yml` and `sam-template.yml`
1919
# production-deployment-workflow: with the workflow file stub for production deploy from merge
@@ -135,7 +135,7 @@ steps:
135135
right: closed
136136
- left: '%payload.pull_request.merged%'
137137

138-
# we reprotect master for the next PR
138+
# we reprotect main for the next PR
139139
- type: updateBranchProtection
140140

141141
# PART 2: AWS CONFIGURATION
@@ -194,11 +194,11 @@ steps:
194194
# we merge
195195
- type: mergeBranch
196196
head: aws-configuration
197-
base: master
197+
base: main
198198

199-
# merge master into staging-test so staging-test has the appropriate updates
199+
# merge main into staging-test so staging-test has the appropriate updates
200200
- type: mergeBranch
201-
head: master
201+
head: main
202202
base: staging-test
203203

204204
# we must prepare next pr now so we can point to it. We ask the user to test this action by adding a label
@@ -252,7 +252,24 @@ steps:
252252
actions:
253253

254254
# We validate
255-
#- type: gate
255+
- type: getFileContents
256+
action_id: fileContents
257+
filename: '.github/workflows/deploy-prod.yml'
258+
required: false
259+
260+
# We validate that trigger is correct
261+
- type: gate
262+
every: true
263+
gates:
264+
- left: '%payload.pull_request.title%'
265+
operator: ===
266+
right: Production deployment workflow
267+
- left: '%actions.fileContents%'
268+
else:
269+
- type: respond
270+
with: 0Xe_unexpected.md
271+
data:
272+
expected: commit the file `.github/workflows/deploy-prod.yml` on a pull request titled "Production deployment workflow"
256273

257274
# Step 10: Choose the environment for AWS
258275

@@ -263,7 +280,7 @@ steps:
263280
# event: commit, user writes the environment
264281

265282
- title: Complete the deployment to production workflow
266-
description: Commit the steps to the production workflow that allow you to deploy on merge to master.
283+
description: Commit the steps to the production workflow that allow you to deploy on merge to main.
267284
event: pull_request
268285
link: '{{ repoUrl }}/pull/3'
269286
actions:
@@ -298,7 +315,7 @@ steps:
298315
# We remove branch protections
299316
- type: removeBranchProtection
300317

301-
# We tell the user to merge, and that their merge will bring the action into `master`, and will also create a deployment into production
318+
# We tell the user to merge, and that their merge will bring the action into `main`, and will also create a deployment into production
302319
- type: respond
303320
with: 12_merge.md
304321

Diff for: responses/01_label-trigger.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We'll learn how to create a workflow that enables Continuous Delivery. You'll:
44
- create a workflow to deploy to staging based on a label
5-
- create a workflow to deploy to production based on merging to master
5+
- create a workflow to deploy to production based on merging to main
66

77
Before you start, you should be familiar with GitHub and Continuous Integration. If you aren't sure where to start, you may want to check out these two Learning Lab courses:
88

Diff for: responses/03_workflow-steps.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: |
5959
npm install
6060
npm run build
61-
- uses: actions/upload-artifact@master
61+
- uses: actions/upload-artifact@main
6262
with:
6363
name: webpack artifacts
6464
path: public/
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/checkout@v1
7373

7474
- name: Download built artifact
75-
uses: actions/download-artifact@master
75+
uses: actions/download-artifact@main
7676
with:
7777
name: webpack artifacts
7878
path: public

Diff for: responses/09_merge-trigger.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
Deployments to production can be manual (like through a Chat Ops command), or automated (if, say, we trust our pull request review process and we've followed continuous integration practices).
44

5-
We'll trigger a deployment to the production environment whenever something is committed to master. Our master branch is protected, so the only way for commits to appear on master is for a pull request to have been created and gone through the proper review process and merged.
5+
We'll trigger a deployment to the production environment whenever something is committed to main. Our main branch is protected, so the only way for commits to appear on main is for a pull request to have been created and gone through the proper review process and merged.
66

77
## Step 8: Write the production deployment trigger
88

9-
Let's create a new workflow that deals specifically with commits to master and handles deployments to prod.
9+
Let's create a new workflow that deals specifically with commits to main and handles deployments to prod.
1010

11-
### :keyboard: Activity: Write the production deployment trigger on merge to master
11+
### :keyboard: Activity: Write the production deployment trigger on merge to main
1212

1313
1. Edit the `deploy-prod.yml` file on this branch, or [use this quick link]({{ repoUrl }}/edit/production-deployment-workflow/.github/CHANGETHIS/deploy-prod.yml?) _(We recommend opening the quick link in another tab)_
1414
2. Rename the file in this pull request to `.github/workflows/deploy-prod.yml`
1515
3. Add a `push` trigger
1616
4. Add `branches` inside the push block
17-
5. Add `- master` inside the branches block
17+
5. Add `- main` inside the branches block
1818
6. Commit your changes to this branch
1919

2020
The file should look like this when you're finished:
@@ -25,5 +25,5 @@ name: Production deployment
2525
on:
2626
push:
2727
branches:
28-
- master
28+
- main
2929
```

Diff for: responses/10_deploy-prod.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Great! The syntax you used tells GitHub Actions to only run that workflow when a commit is made to the master branch.
1+
Great! The syntax you used tells GitHub Actions to only run that workflow when a commit is made to the main branch.
22

33
# Deploying to production
44

@@ -10,7 +10,7 @@ In our case, we can match our production environment to be exactly like our stag
1010

1111
## Step 9: Complete the deployment to production workflow
1212

13-
### :keyboard: Commit the steps to the production workflow that allow you to deploy on merge to master
13+
### :keyboard: Commit the steps to the production workflow that allow you to deploy on merge to main
1414

1515
1. Edit the `deploy-prod.yml` file on this branch, or [use this quick link]({{ repoUrl }}/edit/production-deployment-workflow/.github/workflows/deploy-prod.yml?) _(We recommend opening the quick link in another tab)_
1616
2. Add a `build` and `deploy` job to the workflow
@@ -23,7 +23,7 @@ name: Production deployment
2323
on:
2424
push:
2525
branches:
26-
- master
26+
- main
2727

2828
jobs:
2929
build:
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
npm install
3737
npm run build
38-
- uses: actions/upload-artifact@master
38+
- uses: actions/upload-artifact@main
3939
with:
4040
name: webpack artifacts
4141
path: public/
@@ -49,7 +49,7 @@ jobs:
4949
- uses: actions/checkout@v1
5050

5151
- name: Download built artifact
52-
uses: actions/download-artifact@master
52+
uses: actions/download-artifact@main
5353
with:
5454
name: webpack artifacts
5555
path: public

Diff for: responses/11_workflow-steps.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ All of this happens automatically once a pull request is merged!
2323
uses: actions/checkout@v1
2424

2525
- name: Download built artifact
26-
uses: actions/download-artifact@master
26+
uses: actions/download-artifact@main
2727
with:
2828
name: webpack artifacts
2929
path: public
@@ -44,7 +44,7 @@ name: Production deployment
4444
on:
4545
push:
4646
branches:
47-
- master
47+
- main
4848

4949
jobs:
5050
build:
@@ -56,7 +56,7 @@ jobs:
5656
run: |
5757
npm install
5858
npm run build
59-
- uses: actions/upload-artifact@master
59+
- uses: actions/upload-artifact@main
6060
with:
6161
name: webpack artifacts
6262
path: public/
@@ -70,7 +70,7 @@ jobs:
7070
- uses: actions/checkout@v1
7171

7272
- name: Download built artifact
73-
uses: actions/download-artifact@master
73+
uses: actions/download-artifact@main
7474
with:
7575
name: webpack artifacts
7676
path: public
@@ -90,7 +90,7 @@ jobs:
9090
uses: actions/checkout@v1
9191

9292
- name: Download built artifact
93-
uses: actions/download-artifact@master
93+
uses: actions/download-artifact@main
9494
with:
9595
name: webpack artifacts
9696
path: public

Diff for: responses/12_congratulations.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Now, we just have to wait for the deployment to occur, and for the package to be published to GitHub Packages. When it's completed, you should be able to see it in the [Packages]({{ repoUrl }}/packages) section of your repository. You can get the deployment URL in the [Actions]({{ repoUrl }}/actions) log, just like the staging URL.
44

5+
:bangbang: Remember to destroy or disable the AWS services created during this course if you'd like to ensure they don't consume resources accidentally. As a reminder, the following resources were created on your AWS account:
6+
- IAM user
7+
- S3 bucket
8+
59
![celebrate](https://octodex.github.com/images/jetpacktocat.png)
610

711
This course is now complete! I'll stop responding but the fun doesn't have to stop here.

0 commit comments

Comments
 (0)