Created
October 2, 2020 17:54
-
-
Save shanerbaner82/525285b56380d1802ad54090d304e255 to your computer and use it in GitHub Desktop.
Laravel Github Actions YAML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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