All checks were successful
Deploy to OVH VPS / deploy (push) Successful in 2m1s
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Deploy to OVH VPS
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 10
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Type check
|
|
run: pnpm type-check
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Install rsync
|
|
run: apt-get update -qq && apt-get install -y -qq rsync openssh-client > /dev/null 2>&1
|
|
|
|
- name: Setup SSH key
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.VPS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_deploy
|
|
chmod 600 ~/.ssh/id_deploy
|
|
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy to VPS
|
|
run: |
|
|
rsync -avz --delete \
|
|
-e "ssh -i ~/.ssh/id_deploy" \
|
|
./dist/ \
|
|
${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/var/www/lorenzoiovino.com/
|