Self-hosted runners action-runner folder

I setup a self-hosted runner on a Windows 19 box and I’d like to use it for production deployment. (hopefully I’m using it properly)

I have my YML setup so that when a push goes into master, it runs a few cmds including an npm build and an a PM2 restart.

What I don’t understand is that my actions and code run within a new action-runner folder:

  • C:\actions-runner\_work\app

But my application is being served from another directory:

  • C:\inetpub\app

How to do I get my action changes to take place or reflect in the served location, not the _work directory?

The default working directory of your workflow when using your self-hosted runner is C:\actions-runner\_work\your-repo-name\your-repo-name . If you are using run scripts step, using the working-directory keyword, you can specify the working directory of where to run the command.

- name: Clean install dependencies and build
  run: |
    npm ci
    npm run build
    working-directory: C:\inetpub\app

ahh, thank you, I’ll give this a try

Hi Yanjingzhu, thanks for your help. I have it working at the proper working-directory now, but my entire application is also still in the default directory… Any idea if I can remove that?

C:\actions-runner\_work\your-repo-name\your-repo-name

Sorry for the delay response. Actions/checkout action checks-out your repository under $GITHUB_WORKSPACE
C:\actions-runner_work\your-repo-name\your-repo-name is the GitHub workspace of your workflow.
There is a path input variable of checkout action to specify the path where you want to hold your repo. Please take a note that the path is relative path under the default directory.

- uses: actions/checkout@v2
  with:
 # **Relative path** under $GITHUB_WORKSPACE to place the repository
    path: ''