Skip to content

Merge pull request #17 from Unity-Lab-AI/codex/update-pollinationsfet… #23

Merge pull request #17 from Unity-Lab-AI/codex/update-pollinationsfet…

Merge pull request #17 from Unity-Lab-AI/codex/update-pollinationsfet… #23

Workflow file for this run

name: Deploy GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
# Manual trigger
workflow_dispatch:
# Optional: run when using GitHub merge queue
merge_group:
permissions:
contents: read
actions: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Build and Upload Artifact
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Summarize build
run: |
echo "# Build Summary" >> $GITHUB_STEP_SUMMARY
echo "Event: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
echo "Ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
echo "Commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
- name: Disable Jekyll
run: echo > .nojekyll
# No bundling needed; publish repo root
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: .
report-build-status:
name: Report Build Status
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Report build status to Pages telemetry
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_RESULT: ${{ needs.build.result }}
run: |
set +e
gh --version
# Determine conclusion from the build job result, mapping to accepted values
CONCLUSION="$BUILD_RESULT"
case "$CONCLUSION" in
success) ;;
failure) ;;
cancelled|skipped) CONCLUSION="cancelled" ;;
*) CONCLUSION="neutral" ;;
esac
# Only attempt telemetry when the run exists
if gh api -X GET "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >/dev/null 2>&1; then
echo "Reporting telemetry: run=$GITHUB_RUN_ID conclusion=$CONCLUSION"
gh api -X POST "repos/$GITHUB_REPOSITORY/pages/telemetry" \
-F github_run_id="$GITHUB_RUN_ID" \
-F conclusion="$CONCLUSION" \
&& echo "Telemetry reported" \
|| echo "::notice::Pages telemetry endpoint non-2xx; skipping."
else
echo "::notice::Workflow run $GITHUB_RUN_ID not found for telemetry; skipping."
fi
deploy:
name: Deploy to Pages
needs: build
# Do not deploy for pull_request events; only push/main, merge_group, dispatch
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4