Skip to content

Commit dabeff9

Browse files
committed
chore: enhance GitHub Actions workflow with caching for Composer and npm dependencies
1 parent 918fc01 commit dabeff9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/laravel.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,32 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
# Cache composer and npm dependencies
18+
- name: Cache Composer dependencies
19+
uses: actions/cache@v3
20+
with:
21+
path: vendor
22+
key: composer-${{ hashFiles('**/composer.lock') }}
23+
restore-keys: |
24+
composer-
25+
26+
- name: Cache npm dependencies
27+
uses: actions/cache@v3
28+
with:
29+
path: node_modules
30+
key: npm-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
npm-
33+
1434
# Setup PHP
1535
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
1636
with:
1737
php-version: "8.2"
1838

1939
# Checkout and prepare repo
20-
- uses: actions/checkout@v4
2140
- name: Copy .env
2241
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
2342

0 commit comments

Comments
 (0)