【问题标题】:Deploy my laravel project to shared hosting with github actions使用 github 操作将我的 laravel 项目部署到共享主机
【发布时间】:2022-01-29 17:47:17
【问题描述】:

请我将 GitHub action main.yml 添加到我的 Laravel 项目到共享主机以进行自动部署。部署工作正常,但由于我指定的路径 - server_dir: /home5/app/public_html/,项目被放置在 public_html 之外,我希望将项目文件放入 public_html 文件夹。下面是代码:

name: Glory Deploy Production
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
jobs:
  web-deploy:
    name: Deploying...
    runs-on: ubuntu-latest
    steps:
    - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
      with:
        php-version: '8.0'
    - uses: actions/checkout@v2.3.2
    - name: Copy .env
      run: php -r "file_exists('.env') || copy('.env.example', '.env');"
    - name: Install Dependencies
      run: composer update --ignore-platform-reqs
    - name: Generate key
      run: php artisan key:generate
    - name: Directory Permissions
      run: chmod -R 777 storage bootstrap/cache
    - name: ???? Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.0.0
      with:
        server: ${{ secrets.server }}
        username: ${{ secrets.username}}
        password: ${{ secrets.password}}
        server_dir: /home5/app/public_html/

请问我可以修改指向 public_html 的路径吗?怎么样?

【问题讨论】:

    标签: laravel yaml cpanel github-actions


    【解决方案1】:

    我认为您的 ftp 用户是具有根路径的默认用户

    server_dir: "public_html/"
    

    如果您的用户没有根路径,您必须考虑其路径直到public_html

    【讨论】:

      猜你喜欢
      • 2022-06-18
      • 2018-12-02
      • 2019-09-25
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 2014-09-25
      • 2020-07-19
      • 2020-12-27
      相关资源
      最近更新 更多