add github actions for deploying to vps

This commit is contained in:
Juan Carlos Manzanero Domínguez 2024-07-08 19:07:36 -06:00
parent e771a7e41e
commit 059ca197e5
2 changed files with 42 additions and 0 deletions

23
.github/workflows/cd.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: CD
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
cd ~/apps/website
git pull origin main
pnpm run install
pnpm run build
cp -r ./dist/* /var/www/website

19
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: CI
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build project
uses: actions/setup-node@v2
with:
node-version: 20.x
- run: pnpm install
- run: pnpm run build