@@ -11,23 +11,23 @@ jobs:
11
11
- name : Install Node
12
12
uses : actions/setup-node@v4
13
13
with :
14
- node-version : " lts/*"
15
- cache : ' npm'
14
+ node-version : " lts/*"
15
+ cache : ' npm'
16
16
- name : Create Checksum of package.json
17
17
run : echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
18
18
- name : Restore Cache
19
19
uses : actions/cache/restore@v4
20
20
with :
21
- path : ./node_modules
22
- key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
21
+ path : ./node_modules
22
+ key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
23
23
- name : Install Dependencies
24
24
run : npm install
25
25
- name : Save Cache
26
26
uses : actions/cache/save@v4
27
27
id : cache
28
28
with :
29
- path : ./node_modules
30
- key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
29
+ path : ./node_modules
30
+ key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
31
31
- name : lint javascript
32
32
run : npm run lint
33
33
test :
@@ -54,22 +54,73 @@ jobs:
54
54
- name : Install Node
55
55
uses : actions/setup-node@v4
56
56
with :
57
- node-version : " lts/*"
58
- cache : ' npm'
57
+ node-version : " lts/*"
58
+ cache : ' npm'
59
59
- name : Create Checksum of package.json
60
60
run : echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
61
61
- name : Restore Cache
62
62
uses : actions/cache/restore@v4
63
63
with :
64
- path : ./node_modules
65
- key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
64
+ path : ./node_modules
65
+ key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
66
66
- name : Install Dependencies
67
67
run : npm install
68
68
- name : Save Cache
69
69
uses : actions/cache/save@v4
70
70
id : cache
71
71
with :
72
- path : ./node_modules
73
- key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
72
+ path : ./node_modules
73
+ key : v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
74
74
- name : run tests
75
75
run : npm test
76
+ deploy_dev :
77
+ needs :
78
+ - lint
79
+ - test
80
+ if : github.ref == 'refs/heads/develop'
81
+ uses : 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
82
+ with :
83
+ APP_NAME : ${{ vars.APP_NAME_DEV }}
84
+ DB_NAME : ${{ vars.DB_NAME_DEV }}
85
+ NEW_RELIC_APP_NAME :
86
+ ORGANIZATION_NAME : gsa-opp-analytics
87
+ SPACE_NAME : analytics-dev
88
+ secrets :
89
+ CF_USERNAME : ${{ secrets.CF_USERNAME_DEV }}
90
+ CF_PASSWORD : ${{ secrets.CF_PASSWORD_DEV }}
91
+ API_DATA_GOV_SECRET : ${{ secrets.API_DATA_GOV_SECRET_DEV }}
92
+ NEW_RELIC_LICENSE_KEY :
93
+ deploy_stg :
94
+ needs :
95
+ - lint
96
+ - test
97
+ if : github.ref == 'refs/heads/staging'
98
+ uses : 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
99
+ with :
100
+ APP_NAME : ${{ vars.APP_NAME_STG }}
101
+ DB_NAME : ${{ vars.DB_NAME_STG }}
102
+ NEW_RELIC_APP_NAME :
103
+ ORGANIZATION_NAME : gsa-opp-analytics
104
+ SPACE_NAME : analytics-staging
105
+ secrets :
106
+ CF_USERNAME : ${{ secrets.CF_USERNAME_STG }}
107
+ CF_PASSWORD : ${{ secrets.CF_PASSWORD_STG }}
108
+ API_DATA_GOV_SECRET : ${{ secrets.API_DATA_GOV_SECRET_STG }}
109
+ NEW_RELIC_LICENSE_KEY :
110
+ deploy_prd :
111
+ needs :
112
+ - lint
113
+ - test
114
+ if : github.ref == 'refs/heads/master'
115
+ uses : 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
116
+ with :
117
+ APP_NAME : ${{ vars.APP_NAME_PRD }}
118
+ DB_NAME : ${{ vars.DB_NAME_PRD }}
119
+ NEW_RELIC_APP_NAME : ${{ vars.NEW_RELIC_APP_NAME_PRD }}
120
+ ORGANIZATION_NAME : gsa-opp-analytics
121
+ SPACE_NAME : analytics-production
122
+ secrets :
123
+ CF_USERNAME : ${{ secrets.CF_USERNAME_PRD }}
124
+ CF_PASSWORD : ${{ secrets.CF_PASSWORD_PRD }}
125
+ API_DATA_GOV_SECRET : ${{ secrets.API_DATA_GOV_SECRET_PRD }}
126
+ NEW_RELIC_LICENSE_KEY : ${{ secrets.NEW_RELIC_LICENSE_KEY_PRD }}
0 commit comments