@@ -7,44 +7,65 @@ on: # yamllint disable-line rule:truthy
7
7
8
8
name : 🚀 Deploy to production
9
9
10
+ env :
11
+ APP_RUNNER : ' cd app &&'
12
+
10
13
concurrency : production
11
14
12
15
jobs :
13
16
deployment :
17
+ timeout-minutes : 8
14
18
runs-on : ${{ matrix.os }}
15
19
strategy :
16
- fail-fast : true
17
20
matrix :
18
- os : ["ubuntu-22.04"]
19
- php : ["8.3"]
21
+ os :
22
+ - ubuntu-latest
23
+ php-version :
24
+ - ' 8.3'
25
+ dependencies :
26
+ - locked
20
27
environment :
21
28
name : production
22
29
url : https://prod.laravel-starter-tpl.wayof.dev
23
30
24
31
steps :
32
+ - name : 🛠️ Setup PHP
33
+ uses : shivammathur/setup-php@2.30.4
34
+ with :
35
+ php-version : ${{ matrix.php-version }}
36
+ extensions : curl, libxml, mbstring, zip, fileinfo, decimal, pdo, pdo_mysql
37
+ ini-values : error_reporting=E_ALL
38
+ coverage : none
39
+
25
40
- name : 📦 Check out the codebase
26
- uses : actions/checkout@v4
41
+ uses : actions/checkout@v4.1.6
27
42
with :
28
43
fetch-depth : 0
29
44
30
- - name : 🛠️ Setup PHP
31
- uses : shivammathur/setup-php@v2
45
+ - name : 🛠️ Setup problem matchers
46
+ run : |
47
+ echo "::add-matcher::${{ runner.tool_cache }}/php.json"
48
+
49
+ - name : 🤖 Validate composer.json and composer.lock
50
+ run : make validate-composer
51
+
52
+ - name : 🔍 Get composer cache directory
53
+ uses : wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
32
54
with :
33
- php-version : ${{ matrix.php }}
34
- extensions : curl, libxml, mbstring, zip, fileinfo, decimal
35
- ini-values : error_reporting=E_ALL
36
- tools : composer:v2
55
+ working-directory : app
37
56
38
- - name : ♻️ Restore cached backend dependencies
39
- id : cached-composer-dependencies
40
- uses : actions/cache@v4
57
+ - name : ♻️ Restore cached dependencies installed with composer
58
+ uses : actions/cache@v4.0.2
41
59
with :
42
- path : vendor
43
- key : vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}
60
+ path : ${{ env.COMPOSER_CACHE_DIR }}
61
+ key : php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
62
+ restore-keys : php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
44
63
45
- - name : 📥 Install backend dependencies
46
- if : steps.cached-composer-dependencies.outputs.cache-hit != 'true'
47
- run : cd app && composer install
64
+ - name : 📥 Install "${{ matrix.dependencies }}" dependencies with composer
65
+ uses : wayofdev/gh-actions/actions/composer/install@v3.1.0
66
+ with :
67
+ working-directory : app
68
+ dependencies : ${{ matrix.dependencies }}
48
69
49
70
- name : 📤 Deploy production environment
50
71
uses : deployphp/action@v1
@@ -54,14 +75,10 @@ jobs:
54
75
deployer-version : 7.4.0
55
76
sub-directory : app
56
77
env :
57
- DEPLOYER_STAGING_SLACK_WEBHOOK : ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}
58
- DEPLOYER_STAGING_REMOTE_USER : ${{ secrets.DEPLOYER_STAGING_REMOTE_USER }}
59
- DEPLOYER_STAGING_HOST : " staging.laravel-starter-tpl.wayof.dev"
60
- DEPLOYER_STAGING_BRANCH : " develop"
61
78
DEPLOYER_PROD_SLACK_WEBHOOK : ${{ secrets.DEPLOYER_PROD_SLACK_WEBHOOK }}
62
79
DEPLOYER_PROD_REMOTE_USER : ${{ secrets.DEPLOYER_PROD_REMOTE_USER }}
63
- DEPLOYER_PROD_HOST : " prod.laravel-starter-tpl.wayof.dev"
64
- DEPLOYER_PROD_BRANCH : " master"
80
+ DEPLOYER_PROD_HOST : prod.laravel-starter-tpl.wayof.dev
81
+ DEPLOYER_PROD_BRANCH : master
65
82
66
83
- name : 📦 Create sentry release
67
84
uses : getsentry/action-release@v1
0 commit comments