-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (44 loc) · 1.31 KB
/
CI-CD.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
name: CI/CD
on:
push:
branches:
- main
jobs:
test:
name: Run Test and PHP Stan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: 🏗 Prepare The Environment
run: cp .env.testing .env
- name: 📦 Install Composer Dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: 🏗 Generate Application Key
run: php artisan key:generate
- name: 🏗 Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: 🏗 Execute tests (Unit and Feature tests) via PHPUnit
run: php artisan test --stop-on-failure --env=testing
- name: 🏗 Execute PHP Stan
run: ./vendor/bin/phpstan analyse
deploy:
name: Deploy
needs: test
if: success()
runs-on: ubuntu-latest
environment: Production
steps:
- name: 🚀 Deploy updates
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /home/anton/www/clip-zone.com
make deploy