Skip to content

Commit e766409

Browse files
ci(docs): add Azure SWA deploy workflow (WB-212) (#16)
1 parent 81fd0e2 commit e766409

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy docs
2+
3+
# Builds the docs site and deploys to Azure Static Web Apps on every push
4+
# to the `release` branch.
5+
#
6+
# Required repo secrets:
7+
# SWA_TOKEN Azure Static Web Apps deployment token
8+
# UMAMI_WEBSITE_ID Analytics site ID baked into the docs build
9+
#
10+
# Required repo variable:
11+
# SWA_ENV SWA environment name (leave unset for production)
12+
13+
on:
14+
push:
15+
branches: ["release"]
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
deploy-docs:
23+
name: Build and deploy docs
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
submodules: true
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 22
35+
36+
- name: Enable Corepack
37+
run: npm i -g corepack@latest
38+
39+
- name: Install pnpm
40+
run: corepack prepare
41+
42+
- name: Install dependencies
43+
run: pnpm install --frozen-lockfile
44+
45+
# SDK must build first so TypeDoc can read its compiled types.
46+
- name: Build SDK
47+
run: pnpm --filter @workflowbuilder/sdk build:lib
48+
49+
- name: Build docs
50+
run: pnpm --filter @workflow-builder/docs build
51+
env:
52+
UMAMI_WEBSITE_ID: ${{ secrets.UMAMI_WEBSITE_ID }}
53+
54+
- name: Deploy to Azure Static Web Apps
55+
uses: Azure/static-web-apps-deploy@v1
56+
with:
57+
azure_static_web_apps_api_token: ${{ secrets.SWA_TOKEN }}
58+
action: "upload"
59+
app_location: "apps/docs/dist"
60+
skip_app_build: true
61+
skip_api_build: true
62+
deployment_environment: ${{ vars.SWA_ENV }}

0 commit comments

Comments
 (0)