Build Stride Docs for Azure Web App Staging #108
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
| # More GitHub Actions for Azure: https://github.com/Azure/actions | |
| name: Build Stride Docs for Azure Web App Staging | |
| env: | |
| COMMON_SETTINGS_PATH: en/docfx.json | |
| VERSION: "2.0.0.${{ github.run_number }}" | |
| DOCS_PATH: stride-docs | |
| on: | |
| push: | |
| branches: | |
| - staging | |
| paths-ignore: | |
| - 'README.md' | |
| - 'Stride.Docs.sln' | |
| - 'BuildDocs.ps1' | |
| - 'wiki/**' | |
| - .gitignore | |
| - '.github/**' | |
| workflow_dispatch: | |
| inputs: | |
| skipPdfBuilding: | |
| description: Skip PDF building | |
| required: true | |
| default: true | |
| type: boolean | |
| skipApiBuilding: | |
| description: Skip API building | |
| required: true | |
| default: true | |
| type: boolean | |
| strideBranch: | |
| description: Stride branch to checkout | |
| required: true | |
| default: master | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| # Run this job only if the repository is 'stride3d/stride-docs' | |
| if: github.repository == 'stride3d/stride-docs' | |
| runs-on: windows-2025-vs2026 | |
| steps: | |
| # Checkout the Stride Docs repository from the branch that triggered the workflow | |
| - name: Checkout Stride Docs | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ${{ env.DOCS_PATH }} | |
| lfs: true | |
| - name: Run Global Setup | |
| id: setup | |
| uses: ./stride-docs/.github/actions/setup-stride | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| skip-pdf-building: ${{ inputs.skipPdfBuilding }} | |
| skip-api-building: ${{ inputs.skipApiBuilding }} | |
| stride-branch: ${{ inputs.strideBranch || 'master' }} | |
| - name: Upload artifact for deployment job | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: DocFX-app | |
| path: ./${{ env.DOCS_PATH }}/_site | |
| deploy: | |
| if: github.repository == 'stride3d/stride-docs' | |
| runs-on: windows-2025-vs2026 | |
| needs: build | |
| environment: | |
| name: 'Production' | |
| url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
| steps: | |
| - name: Download artifact from build job | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: DocFX-app | |
| path: ./${{ env.DOCS_PATH }}/_site | |
| - name: Deploy to Azure Web App | |
| id: deploy-to-webapp | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: 'stride-doc' | |
| slot-name: 'staging' | |
| publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_32FCD402B970463A9143B24C9B225749 }} | |
| package: ./${{ env.DOCS_PATH }}/_site |