Hugo站点的静态Azure Web应用程序部署在github中失败,“无法确定应用程序工件的位置”

icomxhvb  于 2023-05-01  发布在  Go
关注(0)|答案(1)|浏览(174)

我正在尝试在Azure上设置一个hugo静态Web应用程序,我遵循(开始)字面上的以下教程:https://learn.microsoft.com/en-us/azure/static-web-apps/publish-hugo。我做的唯一不同的事情是改变了github仓库的名称和网站的名称。
然而,当我的github工作流被触发时,我可以在工作流日志中看到以下异常:
Oryx构建了应用程序文件夹,但无法确定应用程序工件的位置。请指定应用程序对象位置。
以下是github工作流文件,供参考:

name: Azure Static Web Apps CI/CD

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened, closed]
    branches:
      - main

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@v2
        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_AGREEABLE_BEACH_0DCDA1B03 }}
          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
          ###### 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_AGREEABLE_BEACH_0DCDA1B03 }}
          action: "close"

这是日志文件输出:

App Directory Location: '/' was found.
No Api directory specified. Azure Functions will not be created.
Looking for event info
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
---Oryx build logs---

Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220323.2, Commit: a7f6e2eb2eb42b5c2283d25131ef1f097480015e, ReleaseTagName: 20220323.2

Build Operation ID: |A8hf7rSNRrE=.c43f78be_
Repository Commit : ff7e914452669bb52cffa74[11](https://github.com/SamVanhoutte/solida/runs/6470725399?check_suite_focus=true#step:4:11)2225aa7b307480f

Detecting platforms...
Detected following platforms:
  hugo: 0.90.1

Source directory     : /github/workspace
Destination directory: /bin/staticsites/ss-oryx/app

Using Hugo version:
hugo v0.90.1-48907889+extended linux/amd64 BuildDate=2021-[12](https://github.com/SamVanhoutte/solida/runs/6470725399?check_suite_focus=true#step:4:12)-10T10:56:41Z VendorInfo=gohugoio

Start building sites … 
hugo v0.90.1-48907889+extended linux/amd64 BuildDate=[20](https://github.com/SamVanhoutte/solida/runs/6470725399?check_suite_focus=true#step:4:20)[21](https://github.com/SamVanhoutte/solida/runs/6470725399?check_suite_focus=true#step:4:21)-12-10T10:56:[41](https://github.com/SamVanhoutte/solida/runs/6470725399?check_suite_focus=true#step:4:41)Z VendorInfo=gohugoio

                   | EN  
-------------------+-----
  Pages            |  7  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  2  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 110 ms
Preparing output...

Copying files to destination directory '/bin/staticsites/ss-oryx/app'...
Done in 0 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.

Done in 0 sec(s).

---End of Oryx build logs---
Oryx built the app folder but was unable to determine the location of the app artifacts. Please specify the app artifact location.

For further information, please visit the Azure Static Web Apps documentation at https://learn.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting
gkn4icbw

gkn4icbw1#

变更

output_location: "" # Built app content directory - optional

通过

output_location: "public"

相关问题