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

39 lines
1004 B
YAML

name: Deploy Portal API
on:
push:
branches:
- production
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action
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!"