Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroverts committed Dec 14, 2020
2 parents 06477e8 + 1a195c1 commit 24b0217
Show file tree
Hide file tree
Showing 109 changed files with 9,221 additions and 7,076 deletions.
13 changes: 10 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

# Connect
VATSIM_OAUTH_BASE=https://auth.vatsim.net
VATSIM_OAUTH_CLIENT=
VATSIM_OAUTH_SECRET=
OAUTH_BASE=https://auth.vatsim.net
OAUTH_CLIENT=
OAUTH_SECRET=

# OAuth variable mapping, leave it as is for Vatsim Connect
# This allows you to fit the data validation your OAuth2 service, the - character indicates array structure
OAUTH_MAPPING_CID=data-cid
OAUTH_MAPPING_FIRSTNAME=data-personal-name_first
OAUTH_MAPPING_LASTNAME=data-personal-name_last
OAUTH_MAPPING_EMAIL=data-personal-email

#Branding
SITE_TITLE="Booking"
Expand Down
13 changes: 0 additions & 13 deletions .env.gitlab.testing

This file was deleted.

134 changes: 96 additions & 38 deletions .github/workflows/laravel-mysql.yml → .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,150 @@
# GitHub Action for Laravel with MySQL and Redis
name: Testing Laravel with MySQL
# GitHub Action for Laravel with MySQL
name: CI/CD
on: [push, pull_request]
jobs:
laravel:
name: Laravel (PHP ${{ matrix.php-versions }})
build-js:
name: Build JS / CSS
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get node.js cache directory
id: node-cache-dir
run: echo "::set-output name=dir::$(npm config get cache)" # Use $(yarn cache dir) for yarn

- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn
restore-keys: ${{ runner.os }}-node-

- name: NPM Build
run: |
npm ci
npm run production --no-progress
cat public/mix-manifest.json # See asset versions in log
- name: Upload build files
uses: actions/upload-artifact@v1
with:
name: assets
path: public
test-php:
name: Test PHP
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: homestead
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
php-version: 7.4
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
coverage: pcov #optional
tools: phpcs, phpcpd

- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache

- name: Get composer dev cache directory
id: composer-dev-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ steps.composer-dev-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.testing', '.env');"
php artisan key:generate
- name: Clear Config
run: php artisan config:clear

- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

- name: PHP_CodeSniffer
run: phpcs --extensions=php app

- name: Copy/Paste Detector
run: phpcpd app/ --min-lines=50

- name: Sensiolabs
run: php vendor/sensiolabs/security-checker security:check composer.lock
- name: Get node.js cache directory
id: node-cache-dir
run: echo "::set-output name=dir::$(npm config get cache)" # Use $(yarn cache dir) for yarn
deploy:
name: Run Deployment
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs: build-js
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache NPM dependencies
- name: Download JS / CSS Artifact
uses: actions/download-artifact@v2
with:
name: assets
path: public

- name: Setup PHP, with composer
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: 7.4
extensions: mbstring

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

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn
restore-keys: ${{ runner.os }}-node-
- name: NPM Build
run: |
npm ci
npm run production --no-progress
cat public/mix-manifest.json # See asset versions in log
- name: Upload build files
uses: actions/upload-artifact@v1
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-dev

- name: Setup Deployer
uses: atymic/deployer-php-action@master
with:
name: assets
path: public
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}

- name: Run Deployment [Staging]
if: github.ref == 'refs/heads/dev'
run: php artisan deploy 104.248.84.152 -s upload

- name: Run Deployment [Production]
if: github.ref == 'refs/heads/master'
run: php artisan deploy vps1.dutchvacc.nl -s upload
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ _ide_helper*\.php
\.phpstorm\.meta\.php

htdocs

.lando.yml
Loading

0 comments on commit 24b0217

Please sign in to comment.