-
-
Notifications
You must be signed in to change notification settings - Fork 9
83 lines (68 loc) · 2.29 KB
/
ci.yaml
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
76
77
78
79
80
81
82
83
name: CI
on:
pull_request: ~
push:
branches:
- main
tags:
- '*'
jobs:
cs:
name: Coding style
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install the dependencies
run: composer install --no-interaction --no-progress
- name: Check the coding style
run: vendor/bin/ecs check bin public src tests --config ecs.php --no-progress-bar
- name: Analyze the redirects.yaml
run: bin/yaml-lint redirects.yaml
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install the dependencies
run: composer install --no-interaction --no-progress
- name: Run the unit tests
run: vendor/bin/phpunit
build_and_deploy:
name: Build and deploy
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [cs, tests]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install the dependencies
run: composer install -o --no-dev --no-interaction --no-progress
- name: Dump routes
run: bin/dump-routes
- name: Deploy
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
port: ${{ secrets.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_KEY }}
source: 'public/*,src/*,var/*,vendor/*'
target: ${{ secrets.DEPLOY_TARGET_PATH }}
rm: true