Roman_applicant-site/.gitea/workflows/php.yml

69 lines
1.6 KiB
YAML
Raw Normal View History

2024-01-12 09:10:59 +03:00
name: Tests & Lint & Deploy to Railway
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
steps:
- uses: actions/checkout@v3
- name: Set up PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: PHP Security Checker
uses: StephaneBour/actions-php-security-checker@1.1
- name: Setup project
run: make setup
- name: Check lint
run: make lint
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: make test-coverage
deploy:
needs: build
runs-on: ubuntu-latest
2024-01-15 18:37:02 +03:00
strategy:
matrix:
php-versions: [ '8.1' ]
2024-01-12 09:10:59 +03:00
steps:
2024-01-15 18:37:02 +03:00
- uses: actions/checkout@v3
- name: Set up PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
2024-01-16 09:49:35 +03:00
tools: composer, phpcs, phpstan, phpunit, symfony
2024-01-15 18:37:02 +03:00
- name: PHP Security Checker
uses: StephaneBour/actions-php-security-checker@1.1
2024-01-12 09:10:59 +03:00
2024-01-15 18:37:02 +03:00
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
2024-01-12 09:10:59 +03:00
env:
2024-01-15 18:37:02 +03:00
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
EXCLUDE: "/dist/, /node_modules/"