-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.22 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Pipeline
on:
push:
branches:
- develop
jobs:
ci:
name: Laravel (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pdo_sqlite
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader || composer update --no-progress --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Clear Config
run: php artisan config:clear
- name: Create Database
run: touch database/database.sqlite
- name: Migrate Database
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate
- name: Test with phpunit
run: vendor/bin/phpunit --testdox
deploy-develop:
name: Deploy to dev Enviroment
runs-on: ubuntu-latest
needs: deploy-develop
environment:
name: develop
url: pipelinedevelop.phppiaui.com.br
steps:
- name: Deploy
run: echo "Deploying to develop environment"
deploy-homologacao:
name: Deploy to hmg Enviroment
runs-on: ubuntu-latest
needs: deploy-develop
environment:
name: homologacao
url: pipelinehomologacao.phppiaui.com.br
steps:
- name: Deploy
run: echo "Deploying to homologacao environment"
deploy-producao:
name: Deploy to prod Enviroment
runs-on: ubuntu-latest
needs: deploy-homologacao
environment:
name: production
url: pipeline.phppiaui.com.br
steps:
- name: Deploy
run: echo "Deploying to production environment"