Merge pull request #8 from juancmandev/dev

add github actions for deploying to vps
This commit is contained in:
Juan Manzanero 2024-07-09 01:46:58 +00:00 committed by GitHub
commit 780d1bc0e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 52 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

29
.github/workflows/ci.yml vendored Normal file
View 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