Skip to content

Commit c0e8236

Browse files
authored
Merge pull request #392 from wayofdev/feat/laravel-11
2 parents 3733970 + 44014c7 commit c0e8236

File tree

2 files changed

+76
-48
lines changed

2 files changed

+76
-48
lines changed

.github/workflows/deploy-release.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,58 @@ concurrency: production
1111

1212
jobs:
1313
deployment:
14+
timeout-minutes: 8
1415
runs-on: ${{ matrix.os }}
1516
strategy:
16-
fail-fast: true
1717
matrix:
18-
os: ["ubuntu-22.04"]
19-
php: ["8.3"]
18+
os:
19+
- ubuntu-latest
20+
php-version:
21+
- '8.3'
22+
dependencies:
23+
- locked
2024
environment:
2125
name: production
2226
url: https://prod.laravel-starter-tpl.wayof.dev
2327

2428
steps:
29+
- name: 🛠️ Setup PHP
30+
uses: shivammathur/setup-php@2.30.4
31+
with:
32+
php-version: ${{ matrix.php-version }}
33+
extensions: curl, libxml, mbstring, zip, fileinfo, decimal, pdo, pdo_mysql
34+
ini-values: error_reporting=E_ALL
35+
coverage: none
36+
2537
- name: 📦 Check out the codebase
26-
uses: actions/checkout@v4
38+
uses: actions/checkout@v4.1.6
2739
with:
2840
fetch-depth: 0
2941

30-
- name: 🛠️ Setup PHP
31-
uses: shivammathur/setup-php@v2
42+
- name: 🛠️ Setup problem matchers
43+
run: |
44+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
45+
46+
- name: 🤖 Validate composer.json and composer.lock
47+
run: make validate-composer
48+
49+
- name: 🔍 Get composer cache directory
50+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
3251
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
52+
working-directory: app
3753

38-
- name: ♻️ Restore cached backend dependencies
39-
id: cached-composer-dependencies
40-
uses: actions/cache@v4
54+
- name: ♻️ Restore cached dependencies installed with composer
55+
uses: actions/cache@v4.0.2
4156
with:
42-
path: vendor
43-
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}
57+
path: ${{ env.COMPOSER_CACHE_DIR }}
58+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
59+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
4460

45-
- name: 📥 Install backend dependencies
46-
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
47-
run: cd app && composer install
61+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
62+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
63+
with:
64+
working-directory: app
65+
dependencies: ${{ matrix.dependencies }}
4866

4967
- name: 📤 Deploy production environment
5068
uses: deployphp/action@v1
@@ -54,14 +72,10 @@ jobs:
5472
deployer-version: 7.4.0
5573
sub-directory: app
5674
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"
6175
DEPLOYER_PROD_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_PROD_SLACK_WEBHOOK }}
6276
DEPLOYER_PROD_REMOTE_USER: ${{ secrets.DEPLOYER_PROD_REMOTE_USER }}
63-
DEPLOYER_PROD_HOST: "prod.laravel-starter-tpl.wayof.dev"
64-
DEPLOYER_PROD_BRANCH: "master"
77+
DEPLOYER_PROD_HOST: prod.laravel-starter-tpl.wayof.dev
78+
DEPLOYER_PROD_BRANCH: master
6579

6680
- name: 📦 Create sentry release
6781
uses: getsentry/action-release@v1

.github/workflows/deploy-staging.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,58 @@ concurrency: staging
1111

1212
jobs:
1313
deployment:
14+
timeout-minutes: 8
1415
runs-on: ${{ matrix.os }}
1516
strategy:
16-
fail-fast: true
1717
matrix:
18-
os: ["ubuntu-22.04"]
19-
php: ["8.3"]
18+
os:
19+
- ubuntu-latest
20+
php-version:
21+
- '8.3'
22+
dependencies:
23+
- locked
2024
environment:
2125
name: staging
2226
url: https://staging.laravel-starter-tpl.wayof.dev
2327

2428
steps:
29+
- name: 🛠️ Setup PHP
30+
uses: shivammathur/setup-php@2.30.4
31+
with:
32+
php-version: ${{ matrix.php-version }}
33+
extensions: curl, libxml, mbstring, zip, fileinfo, decimal, pdo, pdo_mysql
34+
ini-values: error_reporting=E_ALL
35+
coverage: none
36+
2537
- name: 📦 Check out the codebase
26-
uses: actions/checkout@v4
38+
uses: actions/checkout@v4.1.6
2739
with:
2840
fetch-depth: 0
2941

30-
- name: 🛠️ Setup PHP
31-
uses: shivammathur/setup-php@v2
42+
- name: 🛠️ Setup problem matchers
43+
run: |
44+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
45+
46+
- name: 🤖 Validate composer.json and composer.lock
47+
run: make validate-composer
48+
49+
- name: 🔍 Get composer cache directory
50+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
3251
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
52+
working-directory: app
3753

38-
- name: ♻️ Restore cached backend dependencies
39-
id: cached-composer-dependencies
40-
uses: actions/cache@v4
54+
- name: ♻️ Restore cached dependencies installed with composer
55+
uses: actions/cache@v4.0.2
4156
with:
42-
path: vendor
43-
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}
57+
path: ${{ env.COMPOSER_CACHE_DIR }}
58+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
59+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
4460

45-
- name: 📥 Install backend dependencies
46-
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
47-
run: cd app && composer install
61+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
62+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
63+
with:
64+
working-directory: app
65+
dependencies: ${{ matrix.dependencies }}
4866

4967
- name: 📤 Deploy staging environment
5068
uses: deployphp/action@v1
@@ -56,11 +74,7 @@ jobs:
5674
env:
5775
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}
5876
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-
DEPLOYER_PROD_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_PROD_SLACK_WEBHOOK }}
62-
DEPLOYER_PROD_REMOTE_USER: ${{ secrets.DEPLOYER_PROD_REMOTE_USER }}
63-
DEPLOYER_PROD_HOST: "prod.laravel-starter-tpl.wayof.dev"
64-
DEPLOYER_PROD_BRANCH: "master"
77+
DEPLOYER_STAGING_HOST: staging.laravel-starter-tpl.wayof.dev
78+
DEPLOYER_STAGING_BRANCH: develop
6579

6680
...

0 commit comments

Comments
 (0)