Merge pull request #93 from Crudzaso/develop #68
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: 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 |