File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build, test and deploy
2
+
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Checkout
12
+ uses : actions/checkout@v4
13
+
14
+ - name : Setup PHP
15
+ uses : shivammathur/setup-php@v2
16
+ with :
17
+ php-version : 8.3
18
+
19
+ - name : Install app
20
+ run : composer install
21
+
22
+ - name : Test PHPUnit
23
+ run : ./vendor/bin/phpstan analyse
24
+
25
+ - name : Test PHPUnit
26
+ run : ./vendor/bin/phpunit
Original file line number Diff line number Diff line change @@ -49,4 +49,51 @@ parameters:
49
49
50
50
5 . How to create GitHub actions
51
51
52
+ ``` bash
53
+ # Create workflow file
54
+
55
+ touch .github/workflows/main.yml
56
+
57
+ ```
58
+
59
+ 6 . Create pipeline for main and develop
60
+
61
+ ``` bash
62
+ name: Build and Deploy
63
+
64
+ on:
65
+ push:
66
+ branches: [ main ]
67
+ ```
68
+
69
+ 7 . Create build job
70
+ ``` bash
71
+ jobs:
72
+ build:
73
+ runs-on: ubuntu-latest
74
+ steps:
75
+ - name: Checkout
76
+ uses: actions/checkout@v4
77
+
78
+ - name: Setup PHP
79
+ uses: shivammathur/setup-php@v2
80
+ with:
81
+ php-version: 8.3
82
+
83
+ - name: Install app
84
+ run: composer install
85
+
86
+ - name: Test PHPUnit
87
+ run: ./vendor/bin/phpstan analyse
88
+
89
+ - name: Test PHPUnit
90
+ run: ./vendor/bin/phpunit
91
+
92
+
93
+
94
+ ```
95
+
96
+ 8 . Create deploy job
97
+
98
+
52
99
6 . CI/CD to VPS
You can’t perform that action at this time.
0 commit comments