-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1 KB
/
deploy-main.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
name: CI/CD - Crudzaso
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Set up SSH Agent
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY_SERVER }}
- name: Deploy Application
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME_SERVER }}@${{ secrets.HOST_SERVER }} << 'EOF'
git config --global --add safe.directory /var/www/gananza
cd ${{ secrets.PATH }}
git pull origin main
echo '${{ secrets.ENV_FILE }}' > .env
composer install --no-dev --optimize-autoloader
npm install
npm run build
php artisan migrate --force
php artisan optimize:clear
php artisan config:cache
php artisan cache:clear
php artisan config:clear
EOF