Skip to content

Instantly share code, notes, and snippets.

@sistematico
Created October 22, 2024 17:05
Show Gist options
  • Save sistematico/91e86b1f0be595dc4ac91a16348bde9e to your computer and use it in GitHub Desktop.
Save sistematico/91e86b1f0be595dc4ac91a16348bde9e to your computer and use it in GitHub Desktop.
Github workflow to deploy a page under a VPS using Bun and Vite
#!/usr/bin/env bash
PATH=$PATH:/home/nginx/.bun/bin
bun install
bun run build
name: Deploy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Copy site via SSH with Password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
port: ${{ secrets.SSH_PORT }}
source: "."
target: ${{ secrets.PROJECT_PATH }}
build:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Add Bun to PATH
shell: bash
run: |
echo "/home/nginx/.bun/bin" >> $GITHUB_PATH
- name: Deploy using SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.PROJECT_PATH }}
bash scripts/deploy.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment