ci: 调整workflow
Some checks failed
deploy to server / build-and-deploy (push) Failing after 3m55s

- 修改.nuxt缓存位置
This commit is contained in:
2025-09-24 17:12:08 +08:00
parent 723c0cbb3a
commit ad66ae1b46

View File

@ -3,7 +3,7 @@ name: deploy to server
on: push
jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -24,6 +24,8 @@ jobs:
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
# Nuxt 构建缓存,加快二次构建
- name: Cache Nuxt build
uses: actions/cache@v4
@ -32,28 +34,7 @@ jobs:
key: ${{ runner.os }}-nuxt-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-nuxt-
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run build
- name: Upload build output
uses: actions/upload-artifact@v4
with:
name: nuxt-output
path: .output/
deploy:
runs-on: ubuntu-latest
needs: build
# if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download build output
uses: actions/download-artifact@v4
with:
name: nuxt-output
path: .output/
- name: Rsync build artifact to server
run: rsync -avz --delete .output/ remilia@192.168.86.5:/home/remilia/Jinshenwebsite/front-build