Skip to content

Commit

Permalink
Build & bundle theme assets to remove CDNs (#103)
Browse files Browse the repository at this point in the history
* Build & bundle theme assets to remove CDNs

* Update node version

* Set a name

* Update ci.yml

* Fixed the path
  • Loading branch information
BelleNottelling authored May 7, 2024
1 parent 8baedc2 commit ab4406c
Show file tree
Hide file tree
Showing 11 changed files with 2,524 additions and 49 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,44 @@ jobs:
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- run: php src/Vendor/bin/phpstan

build-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer:v2
extensions: apcu


- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev

- uses: actions/setup-node@v4
with:
node-version: 'latest'

- name: Install NPM packages and build frontend
run: |
npm i
npm run build
- uses: actions/upload-artifact@v4
with:
path: "./src"
name: "AntCMS"
10 changes: 10 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 'latest'

- name: Install NPM packages and build frontend
run: |
npm i
npm run build
- uses: php-actions/composer@v6
with:
dev: no
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ src/Config/Pages.yaml
src/php_error.log
/.phpunit.cache
/reports
/src/Themes/Default/Assets/build
/tmp
Loading

0 comments on commit ab4406c

Please sign in to comment.