1

I have a project which contains 2 folder: backend and frontend. In each folder i added the corresponded project, each project has its own package.json. Also in each folder/project i have .github with sett workflow/file.yml where is sett github actions for backend and also for frontend
EX: 1. frontend/.github/workflows/file.yml and 2. backend/.github/workflows/file.yml.backend folder is the root and frontend is located inside it.
Now if i push my changes being in backend folder i trigger only BE github actions, but i also need to run the frontend actions.
Question: Does somebody face this kind of issue and how to run both github actions?

Asking
  • 3,487
  • 11
  • 51
  • 106
  • 1
    Can you how your current workflows ? – Grzegorz Krukowski May 17 '22 at 16:05
  • @Grzegorz Krukowski , Both workflow works, i need to know only if i can to run `frontend` together with `backend` workflow? Because now is run only `backend` being as a root folder. – Asking May 17 '22 at 17:02
  • The `.github` directory can only exist in the root. Others are ignored. GitHub Actions don't work very well with monorepos, but e.g. here's a workaround: https://stackoverflow.com/questions/72252469/two-projects-in-one-repository-with-github-actions-monorepo/72268873#72268873 – rethab May 18 '22 at 06:47

1 Answers1

0

You can run many workflows at same time, as you want.

  • You must have a .github/workflows folder, where your actions will be;
  • Each file must have a on clause
  • Use cd backend and cd frontend to access file on subdirectories during the action
  • You can add some pwd && ls to check if you are on right directory

It's enough to run more than on action, for the back and the front.

Tiago Gouvêa
  • 15,036
  • 4
  • 75
  • 81