Owen Conti

GitHub Actions Workflow File for a Laravel Application

Posted on under Laravel by Owen Conti.

The following workflow script can be used as a starting point for building and testing a Laravel application with GitHub Actions:

1name: Build
2on: [push]
3 
4jobs:
5 build-js:
6 name: Build JS
7 runs-on: ubuntu-18.04
8 container: 'ohseemedia/laravel-ci:7.3'
9 steps:
10 - uses: actions/checkout@v1
11 - run: yarn install
12 - run: yarn run production
13 build-php:
14 name: Build PHP
15 runs-on: ubuntu-18.04
16 container: 'ohseemedia/laravel-ci:7.3'
17 steps:
18 - uses: actions/checkout@v1
19 - run: composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
20 - name: Configure application
21 run: |
22 cp .env.example .env
23 php artisan cache:clear
24 php artisan config:clear
25 php artisan key:generate
26 - run: ./vendor/bin/phpunit --coverage-text --colors=never

Thanks for reading this article!

Hopefully you found this article useful! If you did, share it on X!

Found an issue with the article? Submit your edits against the repository.