name: Deploy Pages on: workflow_dispatch: workflow_call: inputs: artifact_pattern: required: false type: string default: '*-results' permissions: contents: write jobs: deploy: runs-on: windows-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install build dependencies run: python -m pip install -r requirements-core.txt - name: Download emulator results if: ${{ inputs.artifact_pattern != '' }} uses: actions/download-artifact@v5 with: pattern: ${{ inputs.artifact_pattern }} path: artifacts merge-multiple: true - name: Build and commit gh-pages update shell: powershell run: | git config --global user.name "github actions" git config --global user.email "github@actions" git clone --single-branch --branch gh-pages "https://github.com/${{ github.repository }}.git" pages if (Test-Path "artifacts\\*.json") { Copy-Item -Path artifacts\*.json -Destination pages -Force } else { Write-Host "No emulator JSON artifacts found to publish." } python main.py --dump-emulators-json --dump-tests-json Copy-Item emulators.json, tests.json -Destination pages -Force python build.py --results-dir pages --emulators pages/emulators.json --tests pages/tests.json --output pages/index.html Remove-Item pages\build.py -ErrorAction SilentlyContinue Set-Location pages git add -A if (git diff --cached --quiet) { Write-Host "No gh-pages changes to commit." exit 0 } git commit -m "Update" - name: Push gh-pages changes uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages directory: pages