Skip to content

CI/CD Deploy Digital Ocean #1

CI/CD Deploy Digital Ocean

CI/CD Deploy Digital Ocean #1

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Bun
run: curl -fsSL https://bun.sh/install | bash
- name: Install dependencies
run: bun install
- name: Build project
run: bun run build
- name: Deploy to DigitalOcean Droplet
uses: appleboy/[email protected]
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USER }}
key: ${{ secrets.DO_SSH_KEY }}
port: 22
script: |
cd /path/to/your/app
git pull origin main
bun install
bun run build
# Restart your app - example using pm2
pm2 restart all