Laravel Vapor:无法找到项目的依赖项



我正试图通过laravel vapor部署我的更改,它告诉我:

/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 1: Merge: command not found
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 3: hot-fix/vapor-issue: No such file or directory
Unable to find your project's dependencies. Please run the composer "install" command first.
Error: Process completed with exit code 1.

我试图改变vapor.yml中的内容,但没有解决:

environments:
staging:
timeout: 10
concurrency: 94
warm: 20
storage: str-staging
memory: 768
cli-memory: 768
runtime: 'php-7.4'
database: db-development
scheduler: false
queue: true
queue-concurrency: 1
queue-timeout: 120
queue-memory: 768
mail: false
domain:
- staging.example.com
build:
- 'composer install -o --no-dev'
- 'php artisan event:cache'
- 'php artisan config:cache'
- 'php artisan route:cache'
deploy:
- 'php artisan migrate --force'

知道吗?

我找到了一个解决方案。

这是因为两个问题,而且这两个问题都在.github/workflows/中的yml配置中,我发现github更改了他们的操作。

我的yml配置有如下部分:

- name: Deploy using Laravel Vapor
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
run: /home/runner/.composer/vendor/bin/vapor deploy production --commit=`${{ github.event.head_commit.id }}` --message=`${{ github.event.head_commit.message }}`

但他们删除了处理反向报价(`(,所以我把它改为双报价:

- name: Deploy using Laravel Vapor
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
run: /home/runner/.composer/vendor/bin/vapor deploy production --commit="${{ github.event.head_commit.id }}" --message="${{ github.event.head_commit.message }}"

这解决了以下两个问题:

/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 1: Merge: command not found
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 3: hot-fix/vapor-issue: No such file or directory

的另一个问题

Unable to find your project's dependencies. Please run the composer "install" command first.
Error: Process completed with exit code 1.

在使用laravel vapor:部署之前,我必须添加composer install

yml配置更改:

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-dev
- name: Deploy using Laravel Vapor
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
run: /home/runner/.composer/vendor/bin/vapor deploy production --commit="${{ github.event.head_commit.id }}" --message="${{ github.event.head_commit.message }}"

这对我有帮助,我希望它能帮助其他人。

他似乎找不到这些文件。错误消息告诉您首先运行:composer install。这将解决问题。

相关内容

  • 没有找到相关文章

最新更新