mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 10:36:39 +00: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
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
name: Build Docs
|
|
on:
|
|
push:
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: "3.7"
|
|
- name: Install Flit
|
|
run: python3.7 -m pip install flit
|
|
- name: Install docs extras
|
|
run: python3.7 -m flit install --extras doc
|
|
- name: Build Docs
|
|
run: python3.7 ./scripts/docs.py build-all
|
|
- name: Zip docs
|
|
run: bash ./scripts/zip-docs.sh
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: docs-zip-${{ github.sha }}
|
|
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
|
|
uses: nwtgck/actions-netlify@v1.0.3
|
|
with:
|
|
publish-dir: './site'
|
|
production-branch: master
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
env:
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|