feat(proposal): integrate faculty reviewers into proposal documents a… #69
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: Production Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| deployments: read | |
| concurrency: | |
| group: production-deploy-status | |
| cancel-in-progress: true | |
| jobs: | |
| wait-for-server: | |
| name: Wait for server deploy | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Wait for server deployment status | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| SHA: ${{ github.sha }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| set -euo pipefail | |
| echo "Waiting for server deploy of ${SHA:0:7}..." | |
| for attempt in $(seq 1 90); do | |
| DEPLOY_ID="$(gh api "repos/${REPO}/deployments?sha=${SHA}&environment=production&per_page=10" \ | |
| --jq '[.[] | select(.description == "Eventio production deploy")] | .[0].id // empty' 2>/dev/null || true)" | |
| if [[ -z "$DEPLOY_ID" ]]; then | |
| echo "Attempt ${attempt}/90: waiting for server to register deployment" | |
| sleep 10 | |
| continue | |
| fi | |
| STATE="$(gh api "repos/${REPO}/deployments/${DEPLOY_ID}/statuses" --jq '.[0].state // empty' 2>/dev/null || true)" | |
| DESC="$(gh api "repos/${REPO}/deployments/${DEPLOY_ID}/statuses" --jq '.[0].description // empty' 2>/dev/null || true)" | |
| echo "Attempt ${attempt}/90: server deployment ${DEPLOY_ID} -> ${STATE}" | |
| case "$STATE" in | |
| success) | |
| echo "Production deploy succeeded" | |
| echo "${DESC}" | |
| exit 0 | |
| ;; | |
| failure|error) | |
| echo "::error title=Production deploy failed::${DESC}" | |
| echo "" | |
| echo "=== Production deploy failed ===" | |
| echo "${DESC}" | |
| echo "" | |
| echo "Deployment: https://github.com/${REPO}/deployments/activity_log?environment=production" | |
| exit 1 | |
| ;; | |
| pending|in_progress|queued) | |
| if [[ -n "$DESC" ]]; then | |
| echo " status: ${DESC}" | |
| fi | |
| ;; | |
| *) | |
| echo "Unknown state: ${STATE}" | |
| ;; | |
| esac | |
| sleep 10 | |
| done | |
| echo "::error title=Production deploy timed out::Server did not report success within 15 minutes" | |
| exit 1 |