-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.3 KB
/
Copy pathdeploy.yml
File metadata and controls
44 lines (37 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Deploy
# Deploys the static export to Azure Static Web Apps on every push to the
# default branch. We build in this workflow (skip_app_build) so the deploy
# uses the exact same Node version and lockfile as CI, instead of letting
# SWA's Oryx builder auto-detect Next.js and try a hybrid build.
#
# One-time setup (see README "Deployment"):
# 1. Azure Portal → Create Static Web App → plan Free → source "Other"
# 2. Repo Settings → Actions → secret AZURE_STATIC_WEB_APPS_API_TOKEN
# (from the SWA "Manage deployment token" page)
# 3. Repo Settings → Actions → variable SITE_URL (the SWA URL)
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Build static export
run: npm run build
env:
NEXT_PUBLIC_SITE_URL: ${{ vars.SITE_URL }}
- name: Deploy to Azure Static Web Apps
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: upload
app_location: out
skip_app_build: true