首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Hugo站点的静态蔚蓝web应用程序部署在github中失败,“无法确定应用程序工件的位置”

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

Stack Overflow用户
提问于 2022-05-17 12:53:27
回答 1查看 321关注 0票数 0

我正试图在Azure上建立一个hugo应用程序,我按照下面的教程(开始)进行操作:https://learn.microsoft.com/en-us/azure/static-web-apps/publish-hugo。我唯一的不同之处就是更改了github的名称和网站的名称。

但是,当我的github工作流被触发时,我可以在工作流日志中看到以下异常:

Oryx构建了应用程序文件夹,但无法确定应用程序工件的位置。请指定应用程序工件位置。

供参考,这是github工作流文件:

代码语言:javascript
复制
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"

这是日志文件的输出:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2022-10-14 20:56:20

变化

代码语言:javascript
复制
      output_location: "" # Built app content directory - optional

通过

代码语言:javascript
复制
      output_location: "public" 

因为Hugo将将站点构建到这个文件夹中,这是

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72274428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档