Merge pull request #85 from Crudzaso/develop #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD - Crudzaso | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fix git ownership | |
run: | | |
git config --global --add safe.directory "${{ secrets.PATH }}" | |
- name: Executing remote SSH commands using password | |
uses: appleboy/ssh-action@v0.1.6 | |
with: | |
host: ${{ secrets.HOST_SERVER }} | |
username: ${{ secrets.USERNAME_SERVER }} | |
password: ${{ secrets.PASSWORD_SERVER }} | |
port: ${{ secrets.PORT_SERVER }} | |
script: | | |
cd "${{ secrets.PATH }}" | |
git pull origin main | |
git fetch | |
echo '${{ secrets.ENV_FILE }}' > .env | |
composer install --no-dev --optimize-autoloader | |
composer dump-autoload | |
php artisan migrate:fresh --seed || echo "Database migration failed, skipping." | |
php artisan optimize:clear |