Files
portal-api/.github/workflows/deploy.yml
T
2026-09-29 11:18:34 +07:00

39 lines
1.0 KiB
YAML

name: Deploy Portal API
on:
push:
branches:
- production
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script_stop: true
script: |
set -e
cd ~/httpdocs
echo "==> Pulling latest code..."
git fetch origin production
git reset --hard origin/production
echo "==> Running migrations..."
php artisan migrate --force
echo "==> Optimizing Laravel..."
php artisan optimize
echo "==> Deploy completed!"