ci(docker): 使用nvm替代直接运行node容器构建
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 2s
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 2s
修改docker构建流程,通过nvm安装并使用node 20,替代直接运行node容器的方式
This commit is contained in:
parent
5082885ace
commit
d687e47fdc
@ -39,12 +39,20 @@ jobs:
|
||||
|
||||
- name: Build dist in Node container
|
||||
run: |
|
||||
docker run --rm -v "$PWD":/app -w /app node:20 bash -lc '
|
||||
npm ci
|
||||
echo "VITE_APP_BASE_URL=${VITE_APP_BASE_URL}" > .env.pord
|
||||
npm run build:prod
|
||||
tar -C dist -czf site_dist.tgz .
|
||||
'
|
||||
set -e
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
if [ ! -d "$NVM_DIR" ]; then
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
fi
|
||||
. "$NVM_DIR/nvm.sh"
|
||||
nvm install 20
|
||||
nvm use 20
|
||||
node -v
|
||||
npm -v
|
||||
npm ci
|
||||
echo "VITE_APP_BASE_URL=${VITE_APP_BASE_URL}" > .env.pord
|
||||
npm run build:prod
|
||||
tar -C dist -czf site_dist.tgz .
|
||||
|
||||
- name: Prepare target directory
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user