mirror of https://github.com/tiangolo/fastapi.git
♻ Update GitHub actions (#1746)
* 🐛 Fix Gitter notification, use development gitter room until next release * 🔥 Remove trigger docs preview step from build-docs workflow as it requires a more privileged token, so it's now triggered by the preview docs watcher * 🔊 Dump context when building to allow debugging how to refactor the Gitter bot
This commit is contained in:
parent
0f54657377
commit
6ab2841dbb
|
|
@ -24,12 +24,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: docs-zip-${{ github.sha }}
|
name: docs-zip-${{ github.sha }}
|
||||||
path: ./docs.zip
|
path: ./docs.zip
|
||||||
- name: Trigger Docs Preview
|
|
||||||
env:
|
|
||||||
PR: "${{ github.event.number }}"
|
|
||||||
NAME: "docs-zip-${{ github.sha }}"
|
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
run: bash ./scripts/trigger-docs-preview.sh
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
uses: nwtgck/actions-netlify@v1.1.5
|
uses: nwtgck/actions-netlify@v1.1.5
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,13 @@ jobs:
|
||||||
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
|
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
|
||||||
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
|
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
|
||||||
run: bash scripts/publish.sh
|
run: bash scripts/publish.sh
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
- name: Notify
|
- name: Notify
|
||||||
env:
|
env:
|
||||||
GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }}
|
GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAG: ${{ github.ref }}
|
||||||
run: bash scripts/notify.sh
|
run: bash scripts/notify.sh
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ import os
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
room_id = "5c9c9540d73408ce4fbc1403" # FastAPI
|
# room_id = "5c9c9540d73408ce4fbc1403" # FastAPI
|
||||||
# room_id = "5cc46398d73408ce4fbed233" # Gitter development
|
room_id = "5cc46398d73408ce4fbed233" # Gitter development
|
||||||
|
|
||||||
gitter_token = os.getenv("GITTER_TOKEN")
|
gitter_token = os.getenv("GITTER_TOKEN")
|
||||||
assert gitter_token
|
assert gitter_token
|
||||||
github_token = os.getenv("GITHUB_TOKEN")
|
github_token = os.getenv("GITHUB_TOKEN")
|
||||||
assert github_token
|
assert github_token
|
||||||
tag_name = os.getenv("TRAVIS_TAG")
|
tag_name = os.getenv("TAG")
|
||||||
assert tag_name
|
assert tag_name
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#! /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 -v \
|
|
||||||
-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}"'"}}'
|
|
||||||
Loading…
Reference in New Issue