Use Azure and its Static Web Apps service to deploy your Thulite site.

Looking for an example? Check out the official Microsoft Azure Doks example project!

This guide shows how to deploy a Thulite site hosted on GitHub using Visual Studio Code. For other setups, see Microsoft’s guide for the Azure Pipelines Task.

Prerequisites

To follow this guide, you need:

How to deploy

  1. Open your project in VS Code.
  2. Open the Static Web Apps extension, sign in to Azure, and click + to create a new Static Web App. You will be prompted to choose a subscription key.
  3. Follow the wizard to name your app, choose a framework preset, and set the app root (usually /) and build output location (use /public). Because Thulite is not in Azure’s built-in templates, select custom. The wizard then creates a GitHub Action in your repo’s .github folder (created automatically if needed).

    The GitHub Action deploys your app. You can track progress in your repository’s Actions tab on GitHub. When it completes successfully, click Browse Website in the SWA extension progress window to open the deployed site.

Known Issues

Builds can fail if your Node or Hugo version is outdated.

Node version

To resolve this, update your project’s package.json with this snippet:

package.json
{
  "engines": {
    "node": ">=24.13.0"
  },
}

Hugo version

To resolve this, update your workflow file by providing a value for HUGO_VERSION in the env section:

workflow.yml
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
          lfs: false
      - 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_NICE_BUSH_0D736421E }}
          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" # Api source code path - optional
          output_location: "public" # Built app content directory - optional
          ###### End of Repository/Build Configurations ######
        env:
          HUGO_VERSION: 0.161.1

Resources