diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cd1ee63b3d..cd50bf360c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -78,6 +78,43 @@ jobs: with: node-version: '20' + - name: Configure PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: pcov + tools: composer:v2 + + # Add GitHub Auth to Composer + - name: Add Composer GitHub Token + run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + + # Restore Caches + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Restore Composer Cache + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Restore Vendor From Cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} + + # Install + - name: Install Composer Dependencies + run: | + composer install --no-interaction + php artisan package:discover + # # NODE BUILD # Install node_modules and run webpack @@ -109,6 +146,9 @@ jobs: - name: Remove node_modules run: 'rm -rf node_modules' + - name: Remove vendor for NPM build. + run: 'rm -rf vendor' + # # DEPLOYMENT # Prepare remote environment and deploy application