add CI
Tests & Lint & Deploy to Railway / build (2.6.6, 20.x, 8.3) (push) Failing after 1m25s Details
Tests & Lint & Deploy to Railway / deploy (push) Has been skipped Details

This commit is contained in:
aslan 2024-04-22 10:59:15 +03:00
parent d88ad65e41
commit 907d793c9b
1 changed files with 79 additions and 0 deletions

79
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,79 @@
name: Tests & Lint & Deploy to Railway
on:
push:
branches:
- main
# pull_request:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.3' ]
node-version: ['20.x']
composer-version: ['2.6.6']
steps:
- uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php-version }} with extensions and tools
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: opcache.enable_cli=1, extension=gd
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite
tools: composer:${{ matrix.composer-version }}
env:
debug: true
- name: PHP Security Checker
uses: StephaneBour/actions-php-security-checker@1.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Add keys
run: |
sudo curl -o ~/.composer/keys.tags.pub -sL https://composer.github.io/releases.pub
sudo curl -o ~/.composer/keys.dev.pub -sL https://composer.github.io/snapshots.pub
- name: Install dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH_JSON }}
run: composer install
- name: Setup project
run: make setup-ci
- name: Check lint
run: make lint
- name: Check tests
run: make test
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: deploy to test server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd /usr/share/nginx/my.lks.ru
git stash
git pull --rebase
git stash clear
make setup-prod