Updated Ticker #652
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: Server Deployment | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup SSH | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan -H rswfire.com >> ~/.ssh/known_hosts | |
| - name: Deploy to Server | |
| run: | | |
| ssh ubuntu@rswfire.com << 'EOF' | |
| set -e | |
| cd /var/www/rswfire.com | |
| git fetch origin | |
| git reset --hard origin/main | |
| rm -rf node_modules public/build | |
| npm ci | |
| npm run build | |
| composer update | |
| pip3 install -r requirements.txt | |
| php artisan clear:everything | |
| php artisan migrate --force | |
| php artisan ziggy:generate | |
| echo "✔️ Deployed to rswfire.com: $(date) ($(git rev-parse --short HEAD))" | |
| EOF |