Skip to content

Instantly share code, notes, and snippets.

@shanerbaner82
Created October 2, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shanerbaner82/525285b56380d1802ad54090d304e255 to your computer and use it in GitHub Desktop.
Save shanerbaner82/525285b56380d1802ad54090d304e255 to your computer and use it in GitHub Desktop.
Laravel Github Actions YAML
name: APP NAME
on:
pull_request:
branches: [ branches ]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_URL }}
jobs:
tests:
runs-on: ubuntu-latest
name: Tests
strategy:
matrix:
node-version: [ 10.x ]
steps:
- name: Slack - GitHub Actions Slack integration
uses: act10ns/slack@v1.0.9
with:
status: starting
steps: ${{ toJson(steps) }}
if: always()
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: none
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Install NPM dependencies
run: npm install
- name: Compile assets staging
run: npm run dev
- name: Execute tests
run: vendor/bin/phpunit --verbose
- name: Deploy Staging
if: github.ref == 'refs/heads/staging'
run: curl ${{ secrets.ENVOYER_STAGING }}?sha=${{ github.sha }}
- name: Slack - GitHub Actions Slack integration
uses: act10ns/slack@v1.0.9
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment