New Crowdin updates #2020
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
| name: Azure Static Web Apps CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed, review_requested] | |
| branches: | |
| - main | |
| jobs: | |
| build_job: | |
| if: (github.head_ref != 'localization' && github.event_name == 'push') || (github.head_ref != 'localization' && github.event_name == 'pull_request' && github.event.action != 'closed') || (github.head_ref == 'localization' && github.event.action == 'review_requested') | |
| runs-on: windows-latest | |
| name: Build Documentation | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Cache DocFX | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.dotnet/tools | |
| key: docfx-${{ runner.os }} | |
| - name: Install DocFX | |
| run: dotnet tool install -g docfx --ignore-failed-sources | |
| - name: Generate configs | |
| run: | | |
| python build_scripts/gen_redirects.py | |
| python build_scripts/gen_languages.py | |
| - name: Generate API metadata | |
| run: docfx metadata localizedContent/en/docfx.json | |
| - name: Verify API files generated | |
| run: | | |
| if (!(Test-Path "content/api/toc.yml")) { | |
| Write-Error "API metadata generation failed - toc.yml not found" | |
| exit 1 | |
| } | |
| Write-Host "API files generated: $((Get-ChildItem content/api/*.yml).Count) YAML files" | |
| shell: pwsh | |
| - name: Build all documentation | |
| run: python build-docs.py --all --skip-gen | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: site | |
| path: _site | |
| retention-days: 7 | |
| deploy_job: | |
| if: (github.head_ref != 'localization' && github.event_name == 'push') || (github.head_ref != 'localization' && github.event_name == 'pull_request' && github.event.action != 'closed') || (github.head_ref == 'localization' && github.event.action == 'review_requested') | |
| needs: build_job | |
| runs-on: ubuntu-latest | |
| name: Deploy to Azure | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: site | |
| path: _site | |
| - name: Deploy to Azure Static Web Apps | |
| id: builddeploy | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DELIGHTFUL_MUD_081AFFE03 }} | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| action: "upload" | |
| app_location: "_site" | |
| api_location: "" | |
| output_location: "" | |
| skip_app_build: true | |
| close_pull_request_job: | |
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
| runs-on: ubuntu-latest | |
| name: Close Pull Request Job | |
| steps: | |
| - name: Close Pull Request | |
| id: closepullrequest | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DELIGHTFUL_MUD_081AFFE03 }} | |
| action: "close" |