Wait for a workflow to complete before starting another

Hi,
I want to use Github actions for my lerna.js based monorepo CI/CD process. My repo contains some packages and some services. The ideal flow would be:
(1) for each changed package,  bump it’s version and publish packages to an npm registry (this is done using lerna publish)
(2) after all packages have been published start the deployment of the changed services

In order to achieve this I need to have the (2) workflow wait for the (1) workflow to complete

My first try to achieve this was to have workflow (1) to create a new commit, and have workflow (2) trigger on files changed in that commit, however it seems that the workflow will not trigger when I commit from an action. 

Is there any way to achieve this using Github actions?

Thanks!

I believe the issue is that workflows won’t trigger from actions taken using the Github Actions token provided to a workflow.  If you create a distinct Github token, expose it to your Workflow 1 as a secret, and execute the commit using that, it should trigger subsequent workflows, since it will be indistinguishable from other non-Actions related commits. 

1 Like

Ohh, so thats the trick. Works like a charm! thanks!