add github actions for deploying to vps
This commit is contained in:
parent
e771a7e41e
commit
059ca197e5
23
.github/workflows/cd.yml
vendored
Normal file
23
.github/workflows/cd.yml
vendored
Normal 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
19
.github/workflows/ci.yml
vendored
Normal 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
|
Loading…
x
Reference in New Issue
Block a user