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"