fix: 去除不必要的clientOnly #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-in-github | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }} | |
ALGOLIA_API_KEY: ${{ vars.ALGOLIA_API_KEY }} | |
ALGOLIA_APP_INDEX_DB: ${{ vars.ALGOLIA_APP_INDEX_DB }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.12.2 | |
- name: install pnpm | |
run: npm install -g pnpm | |
- name: Get pnpm store directory | |
shell: bash | |
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- name: echo store path | |
run: echo ${{ env.STORE_PATH }} | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: 部署到远端服务器 | |
uses: appleboy/scp-action@master | |
with: | |
key: ${{ secrets.KEY }} | |
username: ${{ secrets.USERNAME }} | |
host: ${{ secrets.HOST }} | |
port: ${{ secrets.PORT }} | |
source: .output/* | |
target: ${{ secrets.PATH }} | |
- name: restart | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{secrets.HOST}} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script_stop: true | |
port: ${{secrets.PORT}} | |
script: | | |
cd ${{secrets.PATH}} | |
git pull | |
pnpm run pm2 | |
pm2 list | |
- name: notice | |
run: curl ${{secrets.CURL_CMD}} |