1

I have a deployment.yml file for deploying Laravel Application on a self-hosted ubuntu server via Github actions but unfortunately I ran into this error

==> Setup PHP
✗ PHP Could not setup PHP 7.3
Error: The process '/bin/bash' failed with exit code 1

How can I fix this error?

deployment.yml file

on:
  push:
    branches:
     - master

jobs:
  create-deployment-artifacts:
    name: create deployment artifacts
    runs-on: self-hosted

    steps:
    - uses: actions/checkout@v2

    - name: Configure PHP 7.3
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.3'
        tools: composer, phpunit
        extensions: mbstring,PDO,grpc,tokenizer,xml,json,ctype,fileinfo,openssl,bcmath

    - name: Install Dependencies
      run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

    - name: Compile Assets
      run: |
         npm install
         npm run prod

    - name: Copy .env
      run: php -r "file_exists('.env') || copy('.env.example', '.env');"

    - name: Generate key
      run: php artisan key:generate

    - name: Directory Permissions
      run: chmod -R 777 storage bootstrap/cache

1 Answer 1

3

Please set the environment variable runner as self-hosted on the setup-php step.

Docs: https://github.com/shivammathur/setup-php#self-hosted-setup

- name: Configure PHP 7.3
  uses: shivammathur/setup-php@v2
  env:
    runner: self-hosted
  with:
    php-version: '7.3'
    tools: composer, phpunit
    extensions: mbstring,PDO,grpc,tokenizer,xml,json,ctype,fileinfo,openssl,bcmath

If it is still failing, please create an issue here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.