Skip to content

Deploy your Thulite Site to Microsoft Azure

Azure is a cloud platform from Microsoft. You can deploy your Thulite site with Microsoft Azure’s Static Web Apps service.

This guide takes you through deploying your Thulite site stored in GitHub using Visual Studio Code. Please see Microsoft guides for using an Azure Pipelines Task for other setups.

Prerequisites

To follow this guide, you will need:

How to deploy

  1. Open your project in VS Code.

  2. Open the Static Web Apps extension, sign in to Azure, and click the + button to create a new Static Web App. You will be prompted to designate which subscription key to use.

  3. Follow the wizard started by the extension to give your app a name, choose a framework preset, and designate the app root (usually /) and built file location (use /public). Thulite is not listed in the built-in templates in Azure so you will need to select custom. The wizard will run and will create a GitHub Action in the .github folder of your repo. (This folder will be automatically created if it does not already exist.)

The GitHub Action will deploy your app (you can see its progress in your repo’s Actions tab on GitHub). When successfully completed, you can view your app at the address shown in the SWA Extension’s progress window by clicking the Browse Website button (this will appear after the GitHub Action has run).

Known Issues

The build fails because an old (no longer supported) Node version and/or Hugo version is used.

Node version

To resolve this, update your projects package.json file with this snippet:

"engines": {
"node": ">=20.11.0"
},

Hugo version

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

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.131.0

Official Resources

More Deployment Guides