Laravel Forge Deployment upon successful build

I’m pretty new to CircleCI and for some reason I just can’t wrap my head around how to call a webhook only on successful build of the master branch with CircleCI 2.0. Currently I am using a script to verify that the PHPUnit test passed or failed then I call the forge webhook upon success. This works fine but doesn’t prevent the deployment hook from happening if it’s a branch other than master.

        - run:
        name: Run PHPUnit tests and deploy
        command: bash .circleci/deploy.sh

What I would like to do is something like this.

- run:
      name: Run PHPUnit tests
      command: ./vendor/bin/phpunit

then IF the build is successful AND the branch is master then perform a wget/curl on the webhook url. I am sure this is something simple. Thanks for any answers on this.

Possible duplicate of:

https://discuss.circleci.com/t/circle-2-0-workflow-filters-should-be-logical-and-not-or/18231

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.