alphagov / govuk_frontend_toolkit

❗️GOV.UK Frontend Toolkit is deprecated, and will only receive major bug fixes and security patches.
MIT License
403 stars 107 forks source link

Perform Travis deployment setup only when deploying #385

Closed dsingleton closed 7 years ago

dsingleton commented 7 years ago

⚠️ Opening this as a fork, to simulate the situation in #383. I tested with the original implementation and the build failed in the same way

Steps in before_install are run for all builds, not just deploys.

For branches/PRs from forks of this repo the install step fails as the user will not have access to the ENV vars used to decrypt files, like encrypted_909ac1036a94_key. This was caught in #383, where a forked PR build consistently fails on the openssl step.

Steps specified in before_deploy are only run if a deployment is triggered [1], which will only happen on master, which can't be triggered by a forked user.

Also adds a couple of inline comments to help explain the steps, which are a little obtuse at first glance.

[1] Travis before_deploy documentation