Separated laravel app to its own folder (#540)

This commit is contained in:
Julien Nahum
2024-08-26 18:24:56 +02:00
committed by GitHub
parent 39b8df5eed
commit 5bd1dda504
546 changed files with 124 additions and 143 deletions

View File

@@ -2,11 +2,10 @@ name: laravel
on:
push:
branches: [ main ]
branches: [main]
pull_request:
jobs:
code_lint:
runs-on: ubuntu-latest
name: Run code linters
@@ -36,15 +35,19 @@ jobs:
coverage: none
- name: Prepare the environment
working-directory: ./api
run: cp .env.example .env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Run PHP lint check
working-directory: ./api
run: ./vendor/bin/pint --test
tests:
@@ -90,8 +93,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 8.2 ]
connection: [ pgsql, mysql ]
php: [8.2]
connection: [pgsql, mysql]
include:
- connection: pgsql
host: localhost
@@ -100,7 +103,7 @@ jobs:
password: postgres
database: postgres
- connection: mysql
host: '127.0.0.1'
host: "127.0.0.1"
port: 3306
user: root
password: test
@@ -133,12 +136,14 @@ jobs:
coverage: none
- name: Prepare the environment
run: cp .env.example .env
run: cp api/.env.example api/.env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Run tests (Unit and Feature)
@@ -154,6 +159,7 @@ jobs:
- name: "Archive log results"
if: always()
uses: actions/upload-artifact@v3
working-directory: ./api
with:
name: log results
path: storage/logs/laravel.log
@@ -163,8 +169,8 @@ jobs:
runs-on: ubuntu-latest
name: Build the Nuxt app
defaults:
run:
working-directory: ./client
run:
working-directory: ./client
steps:
- name: Checkout code
uses: actions/checkout@v2
@@ -172,7 +178,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '20'
node-version: "20"
- uses: actions/cache@v2
with:
@@ -193,7 +199,7 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
production-deploy:
needs: [ code_lint, tests, build-nuxt-app ]
needs: [code_lint, tests, build-nuxt-app]
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
name: Triggers Deployment (Vapor & Amplify)
@@ -230,24 +236,29 @@ jobs:
coverage: none
- name: Prepare the environment
working-directory: ./api
run: cp .env.example .env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Trigger front-end deployment
run: |
run: |
URL="${{ secrets.AMPLIFY_DEPLOY_URL }}"
curl -X POST -d {} "$URL" -H "Content-Type: application/json"
- name: Created encrypted .env file before deployment
working-directory: ./api
run: |
echo "${{ secrets.ENCRYPTED_ENV_FILE }}" >> .env.production.encrypted
echo "${{ secrets.ENCRYPTED_ENV_FILE }}" >> .env.production.encrypted
- name: Deploy back-end to production
working-directory: ./api
run: php vendor/bin/vapor deploy api-production --commit="${GITHUB_SHA}" --message="${GITHUB_REF}"
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}