Description
This feature enables Gitploy to deploy automatically if a new push event is matched with the giving ref pattern. For example, it can be handy if a team wants to deploy when a pull request is merged to the main branch.
Implement
To listen for push events, Gitploy has to add the push event when it creates a new webhook. At now, Gitploy only configures the deployment_status event when a user activates a repository. (code)
And another issue is to specify who is the deployer for auto-deployment. The user who activated the repository called activator could be the deployer for auto-deployment because the activator has admin permission to post a remote deployment and is usually equal to a reviewer.
Example
envs:
- name: prod
auto_deploy_on: refs/heads/main