Files
project-work/NearBeach/.github/workflows/deploy-swagger.yml
2026-10-28 21:00:21 -04:00

39 lines
1.2 KiB
YAML

name: Build Swagger and Deploy to Azure Static Web App
on:
push:
branches:
- develop # or your deployment branch
workflow_dispatch:
jobs:
build-swagger:
runs-on: ubuntu-latest
steps:
- name: 🧾 Checkout Code
uses: actions/checkout@v3
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Match your dev env
- name: 📦 Install Dependencies
run: |
python -m pip install --upgrade pip
pip install django django-rest-framework simplejson pillow drf-spectacular drf-spectacular[sidecar] python-dotenv django_otp django-two-factor-auth django-two-factor-auth[phonenumberslite] azure-storage-blob azure-identity botocore boto3 django-rest-knox
- name: 🔧 Generate Swagger Schema
run: |
python manage.py spectacular --file swagger/swagger.json
- 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"
skip_app_build: true
app_location: "swagger"
output_location: "swagger.json"