我试图通过 github 操作将 laravel 应用程序推送到 ftp 服务器。这是来自我的 deploy.yml 文件的片段。
jobs:
Deployment:
name: Deploy Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.1.0
with:
fetch-depth: 2
- name: Create env file
run: |
touch .env
echo APP_NAME=MyAppName >> .env
echo APP_ENV=production >> .env
echo APP_DEBUG=false >> .env
echo LOG_CHANNEL=daily >> .env
echo DB_DATABASE=${{ secrets.DEV_DB_DATABASE }} >> .env
echo DB_USERNAME=${{ secrets.DEV_DB_USERNAME }} >> .env
echo DB_PASSWORD=${{ secrets.DEV_DB_PASSWORD }} >> .env
echo "!.env" > .git-ftp-include
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Adding Vendor
run: echo "!vendor/" > .git-ftp-include
- name: FTP Deploy Action
uses: SamKirkland/FTP-Deploy-Action@3.1.1
with:
ftp-server: ftp://${{ secrets.DEV_FTP_SERVER }}
ftp-username: ${{ secrets.DEV_FTP_USERNAME }}
ftp-password: ${{ secrets.DEV_FTP_PASSWORD }}
每次作业运行时,它都会在 FTP 服务器上上传整个 vendor/ 目录。供应商文件夹上传需要很长时间。我怎样才能只上传 vendor/ 目录中的更改,或者如果只有 composer.lock 被修改,它将上传 vendor/. 或者我怎样才能让它变得简单、快速和容易?