-
Notifications
You must be signed in to change notification settings - Fork 27
75 lines (69 loc) · 2.14 KB
/
ci.yml
File metadata and controls
75 lines (69 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deployment
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
composer:
name: Install PHP dependencies
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-php
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- name: Install PHP dependencies
if: steps.cache-php.outputs.cache-hit != 'true'
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer config --global home
composer install --no-progress
code-style-php:
name: Check PHP code style
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.4
needs: [composer]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- name: Check PHP code style
env:
PHP_CS_FIXER_IGNORE_ENV: true
run: vendor/bin/phpcs -p --report=full --extensions=php --standard=ruleset.xml src/ bin/ www/
phpstan:
name: Run PHPstan
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.4
needs: [code-style-php]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- name: Run PHPstan
run: |
./vendor/bin/phpstan --error-format=github
deployment:
name: Deployment to server
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Update server
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd /home/fwjoomla/siteData
bin/framework update:server