Set flags on a branch after_success with conditionals

I have the following in our companies enterprise .travis.yml:

after_success:
- ember build --environment=production
- ember build --environment=staging --output-path=dist-staging

After both of these build, I conditionally deploy to S3 the one that is appropriate, based on the current git branch.

It works, but it would save time if I only built the one I actually need. is there way I can just do this on the base branch without having to use stash pop? any advice appreciated.

Not sure why you would need to use git stash pop. You can easily just do this on the base branch without having to use pop. Using pop in this scenario makes little to if any sense to me.

It’s a fairly simple fix, you can just use the test command, I’ll give you an example below:

after_success:
  - test $TRAVIS_BRANCH = "master" &&
    ember build

All travis env variables are available here.