Skip to content

try-4

try-4 #3

Workflow file for this run

name: Deploy to DigitalOcean
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Install Bun
run: |
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH
- name: Install dependencies
run: bun install
- name: Build project
run: bun run build
- name: Deploy to DigitalOcean
run: |
ssh -o StrictHostKeyChecking=no root@${{ secrets.DROPLET_IP }} << 'EOF'
cd /root/your-app-directory
git pull origin main
export DATABASE_URL=${{ secrets.DATABASE_URL }}
export JWT_SECRET=${{ secrets.JWT_SECRET }}
bun install
bun run build
pm2 restart all || pm2 start bun run start --name your-app-name
EOF