File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,63 @@ workflows:
189
189
only: master
190
190
` ` `
191
191
192
+ If you prefer to deploy to Heroku using https, please consider this circleci (2.0) configuration which is even easier :
193
+
194
+ Since we are deploying our app with https, the bash script above needed to setup heroku with ssh is not required anymore.
195
+ For that reason the following steps can be deleted from the configuration :
196
+
197
+ ` ` ` yaml
198
+ - add_ssh_keys: # add key from CircleCI account based on fingerprint
199
+ fingerprints:
200
+ - "48:a0:87:54:ca:75:32:12:c6:9e:a2:77:a4:7a:08:a4"
201
+ - run:
202
+ name: Run Setup Script
203
+ command: bash .circleci/setup-heroku.sh
204
+ ` ` `
205
+
206
+ instead we use the following step
207
+
208
+ ` ` ` yaml
209
+ - run:
210
+ name: Deploy to Heroku
211
+ command: |
212
+ git push https://heroku:[email protected] /$HEROKU_APP_NAME.git HEAD:refs/heads/master
213
+ sleep 5 # sleep for 5 seconds to wait for dynos
214
+ heroku restart
215
+ ` ` `
216
+
217
+ - Result :
218
+
219
+ ` ` ` yaml
220
+ version: 2
221
+ jobs:
222
+ # jobs for building/testing go here
223
+ deploy-job:
224
+ docker:
225
+ - image: my-image
226
+ working_directory: /tmp/my-project
227
+ steps:
228
+ - checkout
229
+ - run:
230
+ name: Deploy Master to Heroku
231
+ command: | # this command is framework-dependent and may vary
232
+ heroku git:remote -a HEROKU_APP_NAME
233
+ git push --force https://heroku:[email protected] /$HEROKU_APP_NAME.git HEAD:refs/heads/master
234
+ sleep 5 # sleep for 5 seconds to wait for dynos
235
+ heroku restart
236
+ workflows:
237
+ version: 2
238
+ build-deploy:
239
+ jobs:
240
+ - build-job
241
+ - deploy-jobs: # only deploy when master successfully builds
242
+ requires:
243
+ - build-job
244
+ filters:
245
+ branches:
246
+ only: master
247
+ ` ` `
248
+
192
249
For additional details,
193
250
refer to the full example in the [2.0 Project Tutorial]({{ site.baseurl }}/2.0/project-walkthrough/).
194
251
You can’t perform that action at this time.
0 commit comments