Merge pull request #215 from SlovakNationalGallery/KOMARCH-290-reorde… #1327
This file contains 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: CI/CD | |
on: push | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-22.04 | |
services: | |
mysql: | |
image: mysql:8.0.37 | |
env: | |
MYSQL_DATABASE: komarch_testing | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 3306:3306 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, bcmath, pdo_mysql, sqlite3, gd, imagick | |
- name: Install ghostscript | |
run: sudo apt install ghostscript | |
- name: Update ImageMagick Policy | |
run: | | |
echo "<policy domain=\"coder\" rights=\"read|write\" pattern=\"PDF\" />" | sudo tee -a /etc/ImageMagick-6/policy.xml | |
# Cache Composer dependencies | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.composer/cache | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Add Composer auth credentials (for Backpack Pro) | |
run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json | |
- run: composer install --no-progress --no-interaction | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Build | |
run: | | |
npm install | |
npm run production | |
# Create the TNTSearch storage directory | |
- name: Create TNTSearch Storage Directory | |
run: mkdir -p /tmp/tntsearch/indexes | |
- name: Test | |
run: php artisan test || exit 1 | |
env: | |
APP_KEY: base64:HXaE/pTpPoSNdHFMl5SpgX2XKtdph3EjrdmvWFDKisE= | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: 3306 | |
DB_DATABASE: komarch_testing | |
DB_USERNAME: root | |
DB_PASSWORD: '' | |
SCOUT_DRIVER: tntsearch | |
TNTSEARCH_STORAGE: /tmp/tntsearch/indexes | |
SCOUT_PREFIX: komarch_test_ | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-22.04 | |
needs: [test] | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
- name: Deploy | |
uses: deployphp/action@v1 | |
with: | |
private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }} | |
known-hosts: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }} | |
deployer-version: 7.3.0 | |
dep: deploy |