This commit is contained in:
parent
e26bf17c17
commit
8121b07b1c
@ -24,26 +24,20 @@ jobs:
|
|||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||||
|
|
||||||
# 设置超时的Node.js安装
|
# 使用系统已安装的 Node.js v16.15.0
|
||||||
- name: Setup Node.js
|
- name: Use system Node.js v16.15.0
|
||||||
uses: actions/setup-node@v3
|
run: |
|
||||||
timeout-minutes: 5
|
echo "Using system Node.js"
|
||||||
with:
|
node --version
|
||||||
node-version: '23.5.0'
|
npm --version
|
||||||
|
# 确保 Node.js 在 PATH 中
|
||||||
|
export PATH=$(dirname $(which node)):$PATH
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: npm install
|
||||||
timeout 300 npm install || {
|
|
||||||
echo "npm install failed or timed out"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: npm run build
|
||||||
timeout 300 npm run build || {
|
|
||||||
echo "Build failed or timed out"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Package dist folder
|
- name: Package dist folder
|
||||||
run: |
|
run: |
|
||||||
@ -53,10 +47,10 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
zip -r frontend-dist.zip dist
|
zip -r frontend-dist.zip dist
|
||||||
mv frontend-dist.zip /yantoo/frontend/
|
sudo mv frontend-dist.zip /yantoo/frontend/
|
||||||
|
|
||||||
- name: Extract package in target directory
|
- name: Extract package in target directory
|
||||||
run: |
|
run: |
|
||||||
cd /yantoo/frontend/
|
cd /yantoo/frontend/
|
||||||
unzip -o frontend-dist.zip
|
sudo unzip -o frontend-dist.zip
|
||||||
rm frontend-dist.zip
|
sudo rm frontend-dist.zip
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user