【发布时间】:2024-06-04 23:50:02
【问题描述】:
我在 Github Actions 中创建了一个动作,用于在 spray.sh 上部署 React App Repo。实际上,所有作业都已成功完成,但在浪涌时部署的作业将因出错而失败
"Run surge ./build http://reactapp-saim.surge.sh --token ***
Running as innovativetech1990@gmail.com (Student)
**Aborted - No such file or directory: ./build**
Error: Process completed with exit code 1."
我的工作代码是
name: React app deploy
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: installing node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: GitHub Action for Yarn
# You may pin to the exact commit or the version.
# uses: Borales/actions-yarn@4965e1a0f0ae9c422a9a5748ebd1fb5e097d22b9
uses: Borales/actions-yarn@v2.3.0
with:
# Yarn command
cmd: install
- name: creating build
run: npm build # npm build
- name: installing surge
run: npm install -g surge
- name: deploying with surge
run: surge ./build http://reactapp-saim.surge.sh --token ${{ secrets.SURGE_TOKEN}}
【问题讨论】:
标签: reactjs continuous-deployment