mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-30 17:50:39 -05:00
* 🍱 Save docs zip when building docs * 🙈 Add docs.zip artifact to .gitignore * 🚀 Update deploy artifact name * ♻️ Upload artifact directory * ✨ Add WIP trigger docs preview * ♻️ Update trigger docs preview * 👷 Update env vars for docs preview * 👷 Update PR extraction * 👷 Try to show GitHub event * 💚 Try to see if GitHub context templates is causing the problem * 💚 Try to debug context GitHub event * 🔊 Debug GitHub event context * 👷 Update debugging action * 👷 Update debug * 👷 Update Action * ♻️ Update script to trigger docs preview * ⚡️ Try to use Zip again to improve speed * 🔧 Update zip scripts * ✨ Add preview docs on event * 🚀 Trigger deploy preview on PRs * 🐛 Fix trigger script env vars
22 lines
503 B
Bash
22 lines
503 B
Bash
#! /usr/bin/env bash
|
|
|
|
set -x
|
|
set -e
|
|
|
|
PR=${PR}
|
|
|
|
if [ -z "$PR" ]; then
|
|
echo "Not a PR build, skip trigger docs preview"
|
|
exit 0
|
|
fi
|
|
|
|
NAME=${NAME:?Variable not set}
|
|
GITHUB_TOKEN=${GITHUB_TOKEN:?Variable not set}
|
|
|
|
curl \
|
|
-X POST \
|
|
-H "Authorization: token ${GITHUB_TOKEN}" \
|
|
-H "Accept: application/vnd.github.v3+json" \
|
|
https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches \
|
|
-d '{"ref":"master", "inputs": {"pr": "'"${PR}"'", "name": "'"${NAME}"'"}}'
|