我正在尝试创建一个管道(将我的github回购与vercel连接起来),这样所做的任何更改都会自动运行一组操作(比如测试),然后进行基本的CI-CD部署。
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy": "vc --cwd build --prod --yes --token=$VERCEL_TOKEN"},
以上是我的package.json
错误消息在github操作错误!命令“react脚本构建”与127个一起退出
on: [push]
jobs:
build-app:
runs-on: ubuntu-22.04
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
steps:
- uses: actions/checkout@v2 #we are USEing this action provided by github which clones the repo
- uses: actions/setup-node@v2
with:
node-version: "18.8.0"
- run: tree #this is bash command
- run: node -v
- name: install node modules
run: yarn
- name: installing react-scripts
run: npm install --save react react-dom react-scripts
- name: Build the project in the cloud mostly azure
run: yarn build
- name: Sets the vercel env
run: |
cd build
mkdir .vercel
cd .vercel
touch project.json
echo "{\"projectId\":\"$VERCEL_PROJECT_ID\",\"orgId\":\"VERCEL_ORG_ID\"}" > project.json
- name: Deploying the project on vercel
run: yarn deploy #see deploy cmd in package.json
- name: setup finish #name is used to name the run cmd
run: echo "done"
test-app:
needs: build-app #test-app is dependendant on the build app
runs-on: ubuntu-22.04
steps:
- run: echo "end to end testing using cypress"发布于 2022-08-31 16:49:27
您应该按照职务日志中的建议,检查Vercel日志。顺便说一句,你能用这个'vc .‘手动部署吗?指挥部?
https://stackoverflow.com/questions/73556439
复制相似问题