From 1e3228e8b3715591cefd891e1eb0eff5668300d8 Mon Sep 17 00:00:00 2001 From: AslanAV Date: Fri, 12 Jan 2024 09:10:59 +0300 Subject: [PATCH] refactor CI deploy run --- .gitea/workflows/php.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.gitea/workflows/php.yml b/.gitea/workflows/php.yml index e69de29..00fce9a 100644 --- a/.gitea/workflows/php.yml +++ b/.gitea/workflows/php.yml @@ -0,0 +1,49 @@ +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 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Deploy + run: make deploy + env: + SSH_TOKEN: ${{ secrets.SSH_TOKEN }}