Merge pull request #18 from Unity-Lab-AI/codex/analyze-github-pages-d… #9
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: Main Branch Delivery | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build and Upload Artifacts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build static site bundle | |
| run: python scripts/build_static.py | |
| - name: Upload static artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| - name: Upload build report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-status-report | |
| path: ci_reports/build_status.json | |
| if-no-files-found: warn | |
| report-build: | |
| name: Report Build Status | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: ${{ always() && needs.build.result != 'cancelled' }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Download build report | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: build-status-report | |
| path: ci_reports | |
| - name: Render build summary | |
| run: python scripts/report_build.py | |
| run-tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run Tests | |
| run: python tests/run_tests.py | |
| - name: Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: main-test-report | |
| path: ci_reports/test_results.json | |
| if-no-files-found: warn | |
| report-tests: | |
| name: Report Tests Statuses | |
| runs-on: ubuntu-latest | |
| needs: run-tests | |
| if: ${{ always() && needs.run-tests.result != 'cancelled' }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Download test report | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: main-test-report | |
| path: ci_reports | |
| - name: Render summary | |
| run: python scripts/report_tests.py | |
| deploy: | |
| name: Deploy to Pages | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: ${{ needs.build.result == 'success' }} | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |