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

Commit e04926b

Browse files
committed
replace the environment var to completing the prod deploy
1 parent 7332f63 commit e04926b

File tree

3 files changed

+64
-27
lines changed

3 files changed

+64
-27
lines changed

config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ steps:
254254

255255
# We tell the user to write the proper environment
256256
- type: respond
257-
with: 10_environment.md
257+
with: 10_deploy-prod.md
258258

259259
# event: commit, user writes the environment
260260

261-
- title: Choose the environment for AWS
262-
description: Commit the proper environment for AWS to the workflow file
261+
- title: Complete the deployment to production workflow
262+
description: Commit the steps to the production workflow that allow you to deploy on merge to master.
263263
event: pull_request
264264
link: '{{ repoUrl }}/pull/3'
265265
actions:

responses/10_deploy-prod.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Great! The syntax you used tells GitHub Actions to only run that workflow when a commit is made to the master branch.
2+
3+
# Deploying to production
4+
5+
Just like with the other workflow, we'll need to build our application and deploy to AWS using the same action as before because we are working with the same `Node.js` app.
6+
7+
**Continuous delivery** is a concept that contains many behaviors and other, more specific concepts. One of those concepts is **test in production**. That can mean different things to different projects and different companies, and isn't a strict rule that says you are or aren't "doing CD".
8+
9+
In our case, we can match our production environment to be exactly like our staging environment. This minimizes opportunities for surprises once we deploy to production.
10+
11+
## Step 10: Complete the deployment to production workflow
12+
13+
### :keyboard: Commit the steps to the production workflow that allow you to deploy on merge to master
14+
15+
Add a `build` and `deploy` job to the workflow in this PR. It should look like the file below when you are finished.
16+
17+
Note that not much has changed from our staging workflow, except for our trigger.
18+
19+
```yml
20+
name: Production deployment
21+
22+
on:
23+
push:
24+
branches:
25+
- master
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v1
33+
- name: npm install and build webpack
34+
run: |
35+
npm install
36+
npm run build
37+
- uses: actions/upload-artifact@master
38+
with:
39+
name: webpack artifacts
40+
path: public/
41+
42+
deploy:
43+
name: Deploy Node.js app to AWS
44+
needs: build
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v1
49+
50+
- name: Download built artifact
51+
uses: actions/download-artifact@master
52+
with:
53+
name: webpack artifacts
54+
path: public
55+
56+
- name: Deploy to AWS
57+
uses: docker://admiralawkbar/aws-nodejs:latest
58+
env:
59+
AWS_ACCESS_KEY: {% raw %}${{ secrets.AWS_ACCESS_KEY }}{% endraw %}
60+
AWS_SECRET_KEY: {% raw %}${{ secrets.AWS_SECRET_KEY }}{% endraw %}
61+
```

responses/10_environment.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)