0

I am trying to connect my github laravel repository to cpanel so I can update the file in cpanel more easily. So I follow the guide in the comments on this link, Is that possible to deploy Laravel web application to shared hosting using GitHub Action & GitHub FTP Deploy? . As I filled all the info required and ran it, the following are the errors that I get. I tried to solve the error and refer to guide on this stackoverflow link in the comments but it is not working, Github action: npm install -> Error: Process completed with exit code 1 . Please help.

Run npm run production
  npm run production
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
npm ERR! Missing script: "production"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-12-06T11_58_08_283Z-debug-0.log
Error: Process completed with exit code 1.

my package.json

{
    "private": true,
    "scripts": {
        "preinstall": "npx npm-force-resolutions",
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.0",
        "alpinejs": "^3.0.6",
        "autoprefixer": "^10.4.7",
        "axios": "^0.25",
        "laravel-vite-plugin": "^0.5.0",
        "lodash": "^4.17.19",
        "postcss": "^8.4.14",
        "tailwindcss": "^3.1.0",
        "vite": "^3.0.0"
    },
    "dependencies": {
        "chart.js": "^3.8.0",
        "chartjs-adapter-moment": "^1.0.0",
        "flatpickr": "^4.6.13",
        "moment": "^2.29.4"
    },
    "resolutions": {
      "node-sass": "https://registry.npmjs.org/dart-sass/-/dart-sass- 
       1.25.0.tgz"
    },

}

my main.yaml file:

on: 
  push:
    branches:
      - main
name:  Deploy website on push
jobs:
  web-deploy:
    name:  Deploy
    runs-on: ubuntu-latest
    steps:
    - name:  Get latest code
      uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.1.11

    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v2
      with:
        path: vendor
        key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-php-

    - name: Save state
      run: echo "{name}={value}" >> $GITHUB_STATE

    - name: Set output
      run: echo "{name}={value}" >> $GITHUB_OUTPUT

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: install npm 
      run:  npm install

    - name: run npm production
      run:  npm run production       
    
    - name:  Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.3
      with:
        server: ftp.sabahloka.com
        username: ${{ secrets.ftp_username }}
        password: ${{ secrets.ftp_password }}
        server-dir: /home/sabahlok/hackathon2.dfa-learning.sabahloka.com/
jabs93
  • 39
  • 8

0 Answers0