Merge pull request #8 from juancmandev/dev
add github actions for deploying to vps
This commit is contained in:
commit
780d1bc0e3
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
|
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
SECRET_POCKETBASE_API_URL: ${{ vars.SECRET_POCKETBASE_API_URL }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: git-checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Build project
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 9
|
||||
- run: pnpm install
|
||||
- run: pnpm run build
|
Loading…
x
Reference in New Issue
Block a user