Files
ApiServer-Web-admin_dashboa…/.gitea/workflows/build-test-server.yaml
T
shiran dda0d0e491
Build and Deploy Vue3 / build (push) Successful in 1m27s
Build and Deploy Vue3 / deploy (push) Successful in 1m6s
fix(ci): pin pnpm version for lockfile compatibility
2026-09-14 10:36:49 +08:00

60 lines
1.5 KiB
YAML

name: 'Build and Deploy Vue3'
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install pnpm
run: |
npm install -g pnpm@8.15.5
- name: Install dependencies
run: |
pnpm install --ignore-scripts
pnpm rebuild
- name: Build project
run: |
pnpm build
- name: Compress artifacts
run: |
tar -czf dist.tar.gz -C ./dist .
- name: Save artifact
uses: actions/upload-artifact@v3
with:
name: vue3-build
path: dist.tar.gz
deploy:
needs: build
runs-on: ninBo
steps:
- name: Download Artifact
uses: https://gitea.s1f.ren/actions/download-artifact@v3
with:
name: vue3-build
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PUBLICT_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ vars.WEB_TEST_SERVER_IP }} >> ~/.ssh/known_hosts
- name: Deploy to server
run: |
DEPLOY_DIR="/www/wwwroot/apiserver_admin.s1f.ren/"
ssh ${{ vars.ROOT_USER_NAME }}@${{ vars.WEB_TEST_SERVER_IP }} "mkdir -p $DEPLOY_DIR"
scp -o StrictHostKeyChecking=no dist.tar.gz ${{ vars.ROOT_USER_NAME }}@${{ vars.WEB_TEST_SERVER_IP }}:$DEPLOY_DIR
ssh ${{ vars.ROOT_USER_NAME }}@${{ vars.WEB_TEST_SERVER_IP }} "cd $DEPLOY_DIR && tar -xzf dist.tar.gz && rm -f dist.tar.gz"