how to do steps on github actions workflow for frontend and backend separately within same repository?

Issue

I have a merchant app github repository which consist of backend and frontend packagesenter image description here

on my .github/workflows directory I created a frontend.yml and backend.yml how can configure to run my workflow on a specific folder?

Solution

Github actions have a working-directory option to declare on workflow. It specifies the working directory for all run steps.

Specify for all Jobs:

defaults:
  run:
    working-directory: api

Documentation: DEFAULTS.RUN

This can be configured for specific jobs too. To set working_directory for a specific job, here is the procedure:

Specify for specific Job:

jobs:
  job1:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: api

Documentation: JOBS.DEFAULTS.RUN

Answered By – GuiFalourd

Answer Checked By – David Marino (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.