我尝试将下一个13应用程序目录应用程序部署到Azure Static Web Apps,但当我转到URL时,它返回500错误。我在Azure上看不到任何日志,在“诊断”选项卡下找不到它们。我的工作流文件如下所示:
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_DUNE_0B46C9510 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # Built app content directory - optional
app_build_command: "npm run build"
api_build_command: "rm -rf ./node_modules/@next/swc-* && rm -rf ./.next/cache"
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_DUNE_0B46C9510 }}
action: "close"
npm run build命令是next build,npm run start是next start。我没有使用下一个出口的原因,它不能与i18使用。为了成功地部署到URL,我可以做些什么?
1条答案
按热度按时间gupuwyp21#
下面是我的
Yaml
代码,检查下面。**结果:**x1c4d 1x