DEV Community

Discussion on: Automate your Laravel app deployment with Github Actions

Collapse
 
nablidev profile image
nablidev

This is a very helpful article that I use as a reference and keep visiting over and over. However, I leave this note comment as a future reference and help for myself and others.

Because the Laravel app uses npm to build its assets and thus also the deploy.sh script on the server, then the deploy.yml needs to indicate that the github action server also needs npm to build the assets. So to the deploy.yml file you need to add the following:

steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: latest
Enter fullscreen mode Exit fullscreen mode

And if you are using nvm on the server to install node then maybe you need to add the following to the deploy.sh script

export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
Enter fullscreen mode Exit fullscreen mode