-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (64 loc) · 1.87 KB
/
pipeline.yml
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: Guru Man
on:
push:
branches:
- production
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
extensions: mbstring, intl, pdo_mysql
key: cache-v1
jobs:
composer:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Show locals
run: pwd && ls -la && ls .github/actions/common-steps/ -la && more /home/runner/work/guruman/guruman/.github/actions/common-steps/action.yml
- name: Run common steps
uses: ./.github/actions/common-steps
with:
php-version: "8.4"
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
lint:
needs: composer
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run common steps
uses: ./.github/actions/common-steps
with:
php-version: "8.4"
- name: Php lint
run: composer lint-ci
test:
needs: composer
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run common steps
uses: ./.github/actions/common-steps
with:
php-version: "8.4"
- name: Php Pest
run: composer test-ci
build:
needs: [test, lint]
runs-on: [self-hosted, production]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Copy code to /var/www/guruman
run: |
sudo cp -R . /var/www/guruman
- name: Change permisions and ownership
run: |
sudo chown -R www-data:www-data /var/www/guruman && sudo chmod -R 755 /var/www/guruman
- name: restart nginx
run: |
sudo service php8.4-fpm restart && sudo service nginx restart