test 2 for protection #12
This file contains hidden or 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: 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 --verbose --filter='.ssh-deploy-filter'" | |
| EXCLUDE: | | |
| .well-known | |
| cgi-bin | |
| .ftpquota | |
| .htaccess | |
| SCRIPT_BEFORE: | | |
| echo "P .well-known/" > .ssh-deploy-filter | |
| echo "P cgi-bin/" >> .ssh-deploy-filter | |
| echo "P .ftpquota" >> .ssh-deploy-filter | |
| echo "P .htaccess" >> .ssh-deploy-filter | |