Skip to content

fix: ci

fix: ci #56

Workflow file for this run

name: Deploy
on:
push:
tags:
- v*.*.*
jobs:
build:
name: Lint, Typecheck, Build, and Deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup pnpm
uses: pnpm/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Lint and Typecheck
run: |
pnpm run typecheck
pnpm run lint
- name: Build project
run: pnpm run build:web
- name: Archive production artifacts
run: tar -cvf build.tar -C ./out/web .
- name: Deploy to remote server
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key
chmod 600 deploy_key
scp -i deploy_key -o StrictHostKeyChecking=no build.tar $DEPLOY_USER@$DEPLOY_HOST:/opt/1panel/apps/openresty/openresty/www/sites/marchen-play.suemor.com/index/
ssh -i deploy_key -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST "cd /opt/1panel/apps/openresty/openresty/www/sites/marchen-play.suemor.com/index/ && tar -xvf build.tar && rm build.tar"