linkdrop #22
This file contains hidden or 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: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup SSH | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add server to known hosts | |
| run: ssh-keyscan -H umar.app >> ~/.ssh/known_hosts | |
| - name: Deploy to server | |
| run: | | |
| ssh umar@umar.app 'set -euo pipefail | |
| cd /var/www/umar.app/projects/linkdrop | |
| git pull origin main | |
| composer install --no-dev --optimize-autoloader --no-interaction | |
| npm ci | |
| npm run build | |
| php artisan migrate --force | |
| php artisan config:cache | |
| php artisan route:cache | |
| php artisan view:cache | |
| sudo systemctl reload php8.3-fpm | |
| echo "Deploy complete."' |