Skip to content

Updated dependencies #255

Updated dependencies

Updated dependencies #255

Workflow file for this run

name: CI
on:
push:
branches: [ main, dev ]
pull_request:
branches:
- '*'
- '!main'
- '!dev'
jobs:
tests:
strategy:
matrix:
version: [8.3]
name: Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
tools: composer
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Build the stack
run: docker-compose up -d
- name: Code Style
run: composer check-style
- name: Static analysis
run: composer stan
- name: Test suite
run: composer unit
deploy_dev:
name: Deploy in dev
needs: tests
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer
- name: Install dependencies
run: APP_ENV=prod APP_DEBUG=1 composer install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-suggest
- name: Rsync deploy
uses: Burnett01/rsync-deployments@5.2.1
with:
switches: -avzr --delete --exclude '.git' --exclude 'var' --exclude '.env.local' --exclude '.env.*.local' --exclude '.github' --exclude '.phpunit.cache' --exclude '.php-cs-fixer.cache'
path: /
remote_path: ${{ secrets.DEPLOY_PATH_DEV }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Execute post-deploy actions
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.DEPLOY_HOST }}
port: ${{ secrets.DEPLOY_PORT }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd ${{ secrets.DEPLOY_PATH_DEV }}
./scripts/post-deploy
deploy_prod:
name: Deploy in production
needs: tests
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer
- name: Install dependencies
run: APP_ENV=prod APP_DEBUG=0 composer install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-suggest
- name: Rsync deploy
uses: Burnett01/rsync-deployments@5.2.1
with:
switches: -avzr --delete --exclude '.git' --exclude 'var' --exclude '.env.local' --exclude '.env.*.local' --exclude '.github' --exclude '.phpunit.cache' --exclude '.php-cs-fixer.cache'
path: /
remote_path: ${{ secrets.DEPLOY_PATH_PROD }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Execute post-deploy actions
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.DEPLOY_HOST }}
port: ${{ secrets.DEPLOY_PORT }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd ${{ secrets.DEPLOY_PATH_PROD }}
./scripts/post-deploy