Skip to content

Merge pull request #87 from Crudzaso/develop #62

Merge pull request #87 from Crudzaso/develop

Merge pull request #87 from Crudzaso/develop #62

Workflow file for this run

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