Skip to content

Commit 406fbda

Browse files
authored
Merge pull request #134405 from craigshoemaker/patch-1
[Static Web Apps] Add custom Hugo version info
2 parents 325b32e + f4b08c0 commit 406fbda

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

articles/static-web-apps/publish-hugo.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,37 @@ Next, you add configuration settings that the build process uses to build your a
146146

147147
:::image type="content" source="./media/publish-hugo/deployed-app.png" alt-text="Deployed application":::
148148

149+
#### Custom Hugo version
150+
151+
When you generate a Static Web App, a [workflow file](./github-actions-workflow.md) is generated which contains the publishing configuration settings for the application. You can designate a specific Hugo version in the workflow file by providing a value for `HUGO_VERSION` in the `env` section. The following example configuration demonstrates how to set set Hugo to a specific version.
152+
153+
```yaml
154+
jobs:
155+
build_and_deploy_job:
156+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
157+
runs-on: ubuntu-latest
158+
name: Build and Deploy Job
159+
steps:
160+
- uses: actions/checkout@v2
161+
with:
162+
submodules: true
163+
- name: Build And Deploy
164+
id: builddeploy
165+
uses: Azure/[email protected]
166+
with:
167+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
168+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
169+
action: "upload"
170+
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
171+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
172+
app_location: "/" # App source code path
173+
api_location: "api" # Api source code path - optional
174+
app_artifact_location: "public" # Built app content directory - optional
175+
###### End of Repository/Build Configurations ######
176+
env:
177+
HUGO_VERSION: 0.58.0
178+
```
179+
149180
## Clean up resources
150181
151182
[!INCLUDE [cleanup-resource](../../includes/static-web-apps-cleanup-resource.md)]

0 commit comments

Comments
 (0)