Working directory is not working in my Github action

Viewed 104

I'm starting to use Github actions. When I ran the process in my Ubuntu server, one of the config options was to select the work folder, by default, I leave _work. But previously, I had my repository in another folder. So, I'm trying to add a specific value for working-directory to my yml, file but is not using the value in the build process.

YML File:

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

defaults:
  run:
    working-directory: /../../../../var/www/mysite.com

jobs:
  deployment:
    runs-on: self-hosted

    steps:

    - name: Checkout
      uses: actions/checkout@v3

    - name: Use Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '14.x'

    - name: Install dependencies
      run: yarn
    - name: Build
      run: yarn build
    - name: Restart server application
      run: pm2 restart pm2_script.json

The process ran ok, but is doing all the process (checkout, build, etc) inside _work and not inside working-directory

What I'm doing wrong?

Thanks!!

0 Answers
Related