Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deployer #13

Merged
merged 14 commits into from
May 9, 2023
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/cache@v3
with:
path: vendor
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}

- name: 📥 Install backend dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
---

on: # yamllint disable-line rule:truthy
release:
types:
- released
push:
branches:
- master
# release:
# types:
# - released
# push:
# tags:
# - 'v*'
tags:
- 'v*'

name: 📦 Deploy to production

defaults:
run:
working-directory: app

jobs:
integration:
deployment:
runs-on: "ubuntu-22.04"
strategy:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1"]
environment:
name: production
url: https://prod.laravel-starter-tpl.wayof.dev
Expand All @@ -33,7 +29,8 @@ jobs:
- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
ini-values: error_reporting=E_ALL
tools: composer:v2

Expand All @@ -42,17 +39,19 @@ jobs:
uses: actions/cache@v3
with:
path: vendor
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}

- name: 📥 Install backend dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
run: composer install
run: cd app && composer install

- name: 📤 Deploy production environment
uses: deployphp/action@v1
with:
private-key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
dep: deploy prod
deployer-version: 7.3.1
sub-directory: app
env:
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}
DEPLOYER_STAGING_REMOTE_USER: ${{ secrets.DEPLOYER_STAGING_REMOTE_USER }}
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ on: # yamllint disable-line rule:truthy

name: 📦 Deploy to staging

defaults:
run:
working-directory: app

jobs:
integration:
runs-on: "ubuntu-22.04"
deployment:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1"]
environment:
name: staging
url: https://staging.laravel-starter-tpl.wayof.dev
Expand All @@ -27,7 +26,8 @@ jobs:
- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
ini-values: error_reporting=E_ALL
tools: composer:v2

Expand All @@ -36,17 +36,19 @@ jobs:
uses: actions/cache@v3
with:
path: vendor
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}

- name: 📥 Install backend dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
run: composer install
run: cd app && composer install

- name: 📤 Deploy staging environment
uses: deployphp/action@v1
with:
private-key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
dep: deploy staging
deployer-version: 7.3.1
sub-directory: app
env:
DEPLOYER_STAGING_SLACK_WEBHOOK: ${{ secrets.DEPLOYER_STAGING_SLACK_WEBHOOK }}
DEPLOYER_STAGING_REMOTE_USER: ${{ secrets.DEPLOYER_STAGING_REMOTE_USER }}
Expand Down