From 17a0126dbc1495dc2d35c8e969aa4f03bf35673a Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Fri, 24 Dec 2021 18:23:06 +0100 Subject: [PATCH] Update workflow --- .github/workflows/php.yml | 58 +++------------------------------------ backend/.htaccess copy | 8 ------ deployment.php | 21 +++----------- 3 files changed, 8 insertions(+), 79 deletions(-) delete mode 100644 backend/.htaccess copy diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index eeec359..13947a3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -52,56 +52,6 @@ jobs: run: | composer install --prefer-dist --no-progress - code_quality: - if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" - defaults: - run: - working-directory: ./server - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.4'] - name: Code Quality ${{ matrix.php-versions }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, intl - ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log - coverage: xdebug, pcov - - - name: Setup NodeJS - uses: actions/setup-node@v2 - with: - node-version: '12' - - - name: WebPack Setup - run: | - cd resources - npm install - ./node_modules/.bin/webpack --version - ./node_modules/.bin/webpack --config webpack.prod.js - ls dist - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: PhpCS report - run: ./vendor/bin/phpcs . --extensions="php,js" --ignore="resources/dist,resources/node_modules,vendor,sw.js" --config-set ignore_errors_on_exit 1 --config-set ignore_warnings_on_exit 1 --report=json > /tmp/phpcs_report.json - - - uses: actions/upload-artifact@v2 - if: ${{ always() }} - with: - name: phpcs_report_${{ github.run_id }} - path: /tmp/phpcs_report.json - staging_deployment: if: github.event.ref == 'refs/heads/staging' needs: tests @@ -115,7 +65,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 extensions: mbstring, intl ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log coverage: xdebug, pcov @@ -123,7 +73,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v2 with: - node-version: '12' + node-version: '14' - name: Deploy run: | @@ -161,7 +111,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 extensions: mbstring, intl ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log coverage: xdebug, pcov @@ -169,7 +119,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v2 with: - node-version: '12' + node-version: '14' - name: Deploy run: | diff --git a/backend/.htaccess copy b/backend/.htaccess copy deleted file mode 100644 index be09a25..0000000 --- a/backend/.htaccess copy +++ /dev/null @@ -1,8 +0,0 @@ -RewriteEngine On - -RewriteCond %{DOCUMENT_ROOT}/backend/dist-frontend/$1 -f -RewriteRule ^(.*)$ dist-frontend/$1 [L] - -RewriteCond %{THE_REQUEST} \s/backend/dist-frontend/ [NC,OR] -RewriteCond $1 !^dist-frontend/ -RewriteRule ^(.*)$ router.php [L] \ No newline at end of file diff --git a/deployment.php b/deployment.php index e07d61f..be64fba 100644 --- a/deployment.php +++ b/deployment.php @@ -1,22 +1,12 @@ 'server', + 'local' => 'backend', 'ignore' => ' .git* .github .vscode *.json - !resources/dist/assets-manifest.json - resources/src - resources/node_modules - resources/webpack* - resources/images/logo.png - resources/images/owner.png - cypress - debug_storage/exception* - debug_storage/*.log - debug_storage/*.json config.old.php config.php *tests* @@ -31,7 +21,6 @@ $baseConfig = [ *.md *.rst *.txt - !resources/dist/*.LICENSE.txt !robots.txt *.sh *editorconfig @@ -46,17 +35,15 @@ $baseConfig = [ *phpstan* *phpunit* vendor/nikic/fast-route/test - vendor/twig/twig/src/Node/Expression/Test - vendor/twig/twig/src/Test *.lock *.zip ', 'allowDelete' => false, 'before' => [ - 'local: cd server && composer update --no-dev -o' + 'local: cd backend && composer update --no-dev -o' ], 'after' => [ - 'local: cd server && composer install' + 'local: cd backend && composer install' ], 'filePermissions' => "0644", 'dirPermissions' => "0755" @@ -77,7 +64,7 @@ foreach ($remotes as $key => $value) { $config[$key]["before"] = []; } else { $env = isset($config[$key]["sentry_env"]) ? $config[$key]["sentry_env"] : "prod"; - $config[$key]["before"][] = "local: cd server/resources && npm i && npm run prod -- --env sentryEnvironment=".$env; + $config[$key]["before"][] = "local: cd frontend && npm ci && npm run build"; } if(isset($value["after"]) && $value["after"] === false){ $config[$key]["after"] = [];