fix: 标准化Node.js版本并配置数据库环境变量 #11
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.12.2] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- run: pnpm install | |
- run: pnpm run build:prod | |
- name: Deploy to Vercel | |
run: npx vercel --token ${VERCEL_TOKEN} --prod | |
env: | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
DB_TYPE: ${{ secrets.DB_TYPE }} | |
DB_HOST: ${{ secrets.DB_HOST }} | |
DB_PORT: ${{ secrets.DB_PORT }} | |
DB_USERNAME: ${{ secrets.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_DATABASE: ${{ secrets.DB_DATABASE }} | |
DB_RETRYDELAY: ${{ secrets.DB_RETRYDELAY }} | |
DB_RETRYATTEMPTS: ${{ secrets.DB_RETRYATTEMPTS }} | |
DB_AUTOLOADENTITIES: ${{ secrets.DB_AUTOLOADENTITIES }} | |
DB_SYNCHRONIZE: ${{ secrets.DB_SYNCHRONIZE }} | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |