From 7a87a21128cdf76b471a68d02988f322e89464cc Mon Sep 17 00:00:00 2001 From: James Brooks Date: Sat, 12 Oct 2024 19:51:48 +0100 Subject: [PATCH] Build assets automatically (#51) --- .github/workflows/compile-assets.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/compile-assets.yml diff --git a/.github/workflows/compile-assets.yml b/.github/workflows/compile-assets.yml new file mode 100644 index 00000000..26e6f068 --- /dev/null +++ b/.github/workflows/compile-assets.yml @@ -0,0 +1,39 @@ +name: Compile Assets + +on: [push] + +jobs: + compile: + name: Compile Assets + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + coverage: none + + - name: Install PHP dependencies + run: | + composer require "laravel/framework:11.x" --no-interaction --no-update + composer update --prefer-dist --no-interaction + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install NPM dependencies + run: npm ci + + - name: Compile assets + run: npm run build + + - name: Commit compiled files + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Compile Assets + file_pattern: "public/build"