Files
armarium-website/.github/workflows/deploy.yml
T
Daniel Krähenbühl c043b2373b Switch to static output and add Azure SWA deployment
- Set output: 'static' in astro.config.mjs; remove Vercel/Netlify adapters
- Remove API routes (contact, newsletter) incompatible with static mode
- Add Azure SWA deploy workflow using @azure/static-web-apps-cli via npx
- Add public/staticwebapp.config.json for SWA routing and 404 fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 21:58:47 +02:00

46 lines
1.3 KiB
YAML

name: Deploy to Azure Static Web Apps
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [main]
jobs:
build_and_deploy:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
run: corepack enable pnpm
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
env:
SITE_URL: ${{ secrets.SITE_URL }}
- name: Deploy to Azure Static Web Apps
run: npx --yes @azure/static-web-apps-cli@latest deploy dist --deployment-token "${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}" --env production
close_pull_request:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Close preview environment
run: npx --yes @azure/static-web-apps-cli@latest deploy --deployment-token "${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}" --env close