Created
October 22, 2024 17:05
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PATH=$PATH:/home/nginx/.bun/bin | |
bun install | |
bun run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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