将我的 Reat Js Typescript 应用程序部署到 Azure 会在工作流程中产生错误

问题描述 投票:0回答:1

我有一个带有 Typescript 的 React JS 应用程序,我正在尝试将其上传到 Azure 服务器。我在 azure 上设置了服务器,将其连接到 github 并调整了工作流程,但部署时总是出现错误。

我确保在 azure 中将节点版本设置为 18 并在我的常规设置配置中添加“pm2serve /home/site/wwwroot --spa --no-daemon”

出了什么问题?

工作流程:

name: Build and deploy Node.js app to Azure Web App - my-add-dev

on:
  push:
    branches:
      - dev
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Node.js version
        uses: actions/setup-node@v1
        with:
          node-version: '18.x'

      - name: npm install, build, and test
        run: |
          npm install
          npm run build --if-present
          #npm run test --if-present

      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v2
        with:
          name: node-app
          path: build/

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: 'Development'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v2
        with:
          name: node-app

      - name: 'Deploy to Azure Web App'
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v2
        with:
          app-name: 'my-add-dev'
          slot-name: 'Production'
          publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_.... }}
          package: .
reactjs azure github github-actions workflow
1个回答
0
投票

构建在本地运行成功了吗?

错误是什么?可以附上一些截图吗?

© www.soinside.com 2019 - 2024. All rights reserved.