@weart

Как пофиксить ошибку github actions + artisan migrate?

Не накатываются миграции

Ошибка

Illuminate\Database\QueryException 
12

13
  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = *** and table_name = migrations and table_type = 'BASE TABLE')
14

15
  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
16
    756▕         // If an exception occurs when attempting to run a query, we'll format the error
17
    757▕         // message to include the bindings with SQL, which will make this exception a
18
    758▕         // lot more helpful to the developer instead of just the database's errors.
19
    759▕         catch (Exception $e) {
20
  ➜ 760▕             throw new QueryException(
21
    761▕                 $query, $this->prepareBindings($bindings), $e
22
    762▕             );
23
    763▕         }
24
    764▕     }
25

26
      +39 vendor frames **m
27
  40  artisan:37
28
      Illuminate\Foundation\Console\Kernel::handle()
29
Error: Process completed with exit code 1.



yml

name: Laravel

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:
    name: Build and Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
      - name: Install PHP dependencies
        run: composer install
      - name: Install NPM dependencies
        run: npm install --force
      - name: Compile assets for production
        run: npm run build
      - name: Directory Permissions
        run: chmod -R 777 storage bootstrap/cache
      - name: Deployment
        uses: burnett01/rsync-deployments@5.2
        with:
          switches: -avzr --delete --exclude="/storage/*" --exclude=".env" --exclude="/node_modules" --exclude="/public/storage"
          path: ./*
          remote_path: /var/www/bb/
          remote_host: ${{ secrets.HOST }}
          remote_port: ${{ secrets.PORT }}
          remote_user: ${{ secrets.USERNAME }}
          remote_key: ${{ secrets.DEPLOY_KEY }}
      - name: Run Migration
        env:
          DB_CONNECTION: mysql
          DB_DATABASE: ${{ secrets.DB_NAME }}
          DB_PORT: 3306
          DB_USER: ${{ secrets.DB_USER }}
          DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
        run: php artisan migrate --force


Гугл читал, но так и не смог победить. Что я упускаю? (
  • Вопрос задан
  • 52 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы