add CI for VPS deployment

This commit is contained in:
artie 2023-07-05 23:32:45 +02:00
parent d893c52947
commit 581142d6a1
3 changed files with 40 additions and 3 deletions

39
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: install deps
run: pnpm i
- name: build the app
run: pnpm build
- name: copy repo with scp
uses: appleboy/scp-action@v0.1.4
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: "./dist/"
target: "/home/artem/artie.moe/"

View File

@ -1 +0,0 @@
rsync -avzh --delete dist/ artem@shironeko:~/artie.moe/public/

View File

@ -7,8 +7,7 @@
"start": "astro dev", "start": "astro dev",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro", "astro": "astro"
"push": "pnpm build && wsl ./deploy.sh"
}, },
"dependencies": { "dependencies": {
"@astrojs/svelte": "^2.1.0", "@astrojs/svelte": "^2.1.0",