Merge remote-tracking branch 'origin/main' into main #118
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
# This Action builds the documentation site in mkdocs | |
# and pushes it to Azure from where it is deployed | |
# to https://iappwksp.com | |
name: deploy-to-az-static-web-apps.yml | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- live | |
permissions: | |
contents: write | |
pull-requests: write # this permission is required in order to allow PR comment with staging URL | |
jobs: | |
build_and_deploy_job: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
env: | |
ENABLE_PDF_EXPORT: 1 # Makes PDF export an option, default disabled, when building locally | |
ENABLE_GIT_COMMITTERS: True # Makes git-committers an option, default disabled, when building locally | |
name: Build and Deploy to Azure | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- run: pip install git+https://${{ secrets.MIYAGI_DOCS_GH_ACTION_TKN }}@github.com/Azure/intelligent-app-workshop.git | |
- run: pip install -r requirements.txt | |
- run: mkdocs build | |
- name: Upload to Azure | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | |
repo_token: ${{ secrets.MIYAGI_DOCS_GH_ACTION_TKN }} # Used for GitHub integrations (i.e. PR comments) | |
action: "upload" | |
production_branch: "main" | |
###### Repository/Build Configurations ###### | |
app_location: "" # App source code path relative to repository root | |
api_location: "" # Api source code path relative to repository root - optional | |
output_location: "site" # Built app content directory, relative to app_location - optional | |
###### End of Repository/Build Configurations ###### | |
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 }} | |
action: "close" |