Skip to content

adding linter

adding linter #8

Workflow file for this run

name: Deploy to ThePlayground
on:
push:
branches: [ "master" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, intl, json, pdo, pdo_mysql
- name: Install Composer dependencies
run: composer install --no-interaction --no-dev --optimize-autoloader
# Static lint check
- name: PHP lint
run: |
find ./ -type f -name "*.php" -print0 | xargs -0 -n1 php -l
# PHPUnit tests (optional)
- name: Run tests
if: ${{ hashFiles('phpunit.xml', 'phpunit.xml.dist') != '' }}
run: vendor/bin/phpunit --colors=never
- name: Prepare build
run: |
mkdir build
rsync -av \
--exclude=".git" \
--exclude=".github" \
--exclude="build" \
./ build/
- name: Dry-run deploy to theplayground.ws
uses: easingthemes/ssh-deploy@v5.0.0
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
REMOTE_PORT: ${{ secrets.SSH_PORT }}
TARGET: "/home/cerberus/public_html/theplayground"
SOURCE: "build/"
ARGS: "--dry-run --delete"
EXCLUDE: |
.well-known
cgi-bin
.ftpquota
.htaccess