Build Stride Docs for Azure Web App Staging #56
This file contains 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 | |
on: | |
push: | |
branches: | |
- staging | |
paths-ignore: | |
- 'README.md' | |
- 'Stride.Docs.sln' | |
- 'BuildDocs.ps1' | |
- 'wiki/**' | |
- .gitignore | |
- '.github/**' | |
workflow_dispatch: | |
jobs: | |
setup: | |
uses: ./.github/workflows/common-setup.yml | |
build: | |
needs: setup | |
runs-on: windows-2022 | |
# Run this job only if the repository is 'stride3d/stride-docs' | |
if: github.repository == 'stride3d/stride-docs' | |
steps: | |
- name: List Contents of Stride Docs Path | |
run: dir | |
working-directory: ${{ needs.setup.outputs.stride_docs_path }} | |
- name: Build documentation | |
run: ./build-all.bat | |
working-directory: ${{ needs.setup.outputs.stride_docs_path }} | |
- name: Compress artifact | |
run: 7z a -r DocFX-app.zip ./${{ needs.setup.outputs.stride_docs_path }}/_site/* | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DocFX-app | |
path: DocFX-app.zip | |
deploy: | |
if: github.repository == 'stride3d/stride-docs' | |
runs-on: windows-2022 | |
needs: [build, setup] | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: DocFX-app | |
# - name: List current directory | |
# run: ls | |
- name: Decompress artifact | |
run: 7z x DocFX-app.zip "-o./stride-docs/_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: ./stride-docs/_site |