Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 089db37

Browse files
authored
Merge branch 'master' into advanced-index
2 parents 6e09f1a + 47524ee commit 089db37

490 files changed

Lines changed: 41175 additions & 41859 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/watch-previews/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/actions/watch-previews/action.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/actions/watch-previews/app/main.py

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/build-docs.yml

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,68 @@ on:
44
branches:
55
- master
66
pull_request:
7-
types: [opened, synchronize]
7+
types:
8+
- opened
9+
- synchronize
810
jobs:
11+
changes:
12+
runs-on: ubuntu-latest
13+
# Required permissions
14+
permissions:
15+
pull-requests: read
16+
# Set job outputs to values from filter step
17+
outputs:
18+
docs: ${{ steps.filter.outputs.docs }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
# For pull requests it's not necessary to checkout the code but for master it is
22+
- uses: dorny/paths-filter@v2
23+
id: filter
24+
with:
25+
filters: |
26+
docs:
27+
- README.md
28+
- docs/**
29+
- docs_src/**
30+
- requirements-docs.txt
31+
langs:
32+
needs:
33+
- changes
34+
runs-on: ubuntu-latest
35+
outputs:
36+
langs: ${{ steps.show-langs.outputs.langs }}
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: Set up Python
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: "3.11"
43+
- uses: actions/cache@v3
44+
id: cache
45+
with:
46+
path: ${{ env.pythonLocation }}
47+
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt') }}-v05
48+
- name: Install docs extras
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
run: pip install -r requirements-docs.txt
51+
# Install MkDocs Material Insiders here just to put it in the cache for the rest of the steps
52+
- name: Install Material for MkDocs Insiders
53+
if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true'
54+
run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
55+
- name: Export Language Codes
56+
id: show-langs
57+
run: |
58+
echo "langs=$(python ./scripts/docs.py langs-json)" >> $GITHUB_OUTPUT
59+
960
build-docs:
61+
needs:
62+
- changes
63+
- langs
64+
if: ${{ needs.changes.outputs.docs == 'true' }}
1065
runs-on: ubuntu-latest
66+
strategy:
67+
matrix:
68+
lang: ${{ fromJson(needs.langs.outputs.langs) }}
1169
steps:
1270
- name: Dump GitHub context
1371
env:
@@ -22,28 +80,35 @@ jobs:
2280
id: cache
2381
with:
2482
path: ${{ env.pythonLocation }}
25-
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v03
83+
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt') }}-v05
2684
- name: Install docs extras
2785
if: steps.cache.outputs.cache-hit != 'true'
28-
run: pip install .[doc]
86+
run: pip install -r requirements-docs.txt
2987
- name: Install Material for MkDocs Insiders
3088
if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true'
3189
run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
90+
- name: Update Languages
91+
run: python ./scripts/docs.py update-languages
92+
- uses: actions/cache@v3
93+
with:
94+
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
95+
path: docs/${{ matrix.lang }}/.cache
3296
- name: Build Docs
33-
run: python ./scripts/docs.py build-all
34-
- name: Zip docs
35-
run: bash ./scripts/zip-docs.sh
97+
run: python ./scripts/docs.py build-lang ${{ matrix.lang }}
3698
- uses: actions/upload-artifact@v3
3799
with:
38-
name: docs-zip
39-
path: ./site/docs.zip
40-
- name: Deploy to Netlify
41-
uses: nwtgck/[email protected]
100+
name: docs-site
101+
path: ./site/**
102+
103+
# https://github.com/marketplace/actions/alls-green#why
104+
docs-all-green: # This job does nothing and is only used for the branch protection
105+
if: always()
106+
needs:
107+
- build-docs
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Decide whether the needed jobs succeeded or failed
111+
uses: re-actors/alls-green@release/v1
42112
with:
43-
publish-dir: './site'
44-
production-branch: master
45-
github-token: ${{ secrets.GITHUB_TOKEN }}
46-
enable-commit-comment: false
47-
env:
48-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
49-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
113+
jobs: ${{ toJSON(needs) }}
114+
allowed-skips: build-docs
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Preview Docs
1+
name: Deploy Docs
22
on:
33
workflow_run:
44
workflows:
@@ -7,40 +7,43 @@ on:
77
- completed
88

99
jobs:
10-
preview-docs:
10+
deploy-docs:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Dump GitHub context
14+
env:
15+
GITHUB_CONTEXT: ${{ toJson(github) }}
16+
run: echo "$GITHUB_CONTEXT"
1317
- uses: actions/checkout@v3
1418
- name: Clean site
1519
run: |
1620
rm -rf ./site
1721
mkdir ./site
1822
- name: Download Artifact Docs
23+
id: download
1924
uses: dawidd6/[email protected]
2025
with:
21-
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
if_no_artifact_found: ignore
27+
github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
2228
workflow: build-docs.yml
2329
run_id: ${{ github.event.workflow_run.id }}
24-
name: docs-zip
30+
name: docs-site
2531
path: ./site/
26-
- name: Unzip docs
27-
run: |
28-
cd ./site
29-
unzip docs.zip
30-
rm -f docs.zip
3132
- name: Deploy to Netlify
33+
if: steps.download.outputs.found_artifact == 'true'
3234
id: netlify
3335
uses: nwtgck/[email protected]
3436
with:
3537
publish-dir: './site'
36-
production-deploy: false
37-
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
production-deploy: ${{ github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' }}
39+
github-token: ${{ secrets.FASTAPI_PREVIEW_DOCS_NETLIFY }}
3840
enable-commit-comment: false
3941
env:
4042
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
4143
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
4244
- name: Comment Deploy
45+
if: steps.netlify.outputs.deploy-url != ''
4346
uses: ./.github/actions/comment-docs-preview-in-pr
4447
with:
45-
token: ${{ secrets.GITHUB_TOKEN }}
48+
token: ${{ secrets.FASTAPI_PREVIEW_DOCS_COMMENT_DEPLOY }}
4649
deploy_url: "${{ steps.netlify.outputs.deploy-url }}"

.github/workflows/issue-manager.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Issue Manager
22

33
on:
44
schedule:
5-
- cron: "0 0 * * *"
5+
- cron: "10 3 * * *"
66
issue_comment:
77
types:
88
- created
@@ -16,11 +16,12 @@ on:
1616

1717
jobs:
1818
issue-manager:
19+
if: github.repository_owner == 'tiangolo'
1920
runs-on: ubuntu-latest
2021
steps:
2122
- uses: tiangolo/[email protected]
2223
with:
23-
token: ${{ secrets.GITHUB_TOKEN }}
24+
token: ${{ secrets.FASTAPI_ISSUE_MANAGER }}
2425
config: >
2526
{
2627
"answered": {

.github/workflows/label-approved.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ on:
66

77
jobs:
88
label-approved:
9+
if: github.repository_owner == 'tiangolo'
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: docker://tiangolo/label-approved:0.0.2
1213
with:
13-
token: ${{ secrets.GITHUB_TOKEN }}
14+
token: ${{ secrets.FASTAPI_LABEL_APPROVED }}

.github/workflows/latest-changes.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ jobs:
3030
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
3131
with:
3232
limit-access-to-actor: true
33-
token: ${{ secrets.ACTIONS_TOKEN }}
34-
standard_token: ${{ secrets.GITHUB_TOKEN }}
3533
- uses: docker://tiangolo/latest-changes:0.0.3
3634
with:
37-
token: ${{ secrets.GITHUB_TOKEN }}
35+
token: ${{ secrets.FASTAPI_LATEST_CHANGES }}
3836
latest_changes_file: docs/en/docs/release-notes.md
3937
latest_changes_header: '## Latest Changes\n\n'
4038
debug_logs: true

.github/workflows/notify-translations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
limit-access-to-actor: true
2020
- uses: ./.github/actions/notify-translations
2121
with:
22-
token: ${{ secrets.GITHUB_TOKEN }}
22+
token: ${{ secrets.FASTAPI_NOTIFY_TRANSLATIONS }}

.github/workflows/people.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
fastapi-people:
15+
if: github.repository_owner == 'tiangolo'
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: actions/checkout@v3
@@ -24,9 +25,7 @@ jobs:
2425
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
2526
with:
2627
limit-access-to-actor: true
27-
token: ${{ secrets.ACTIONS_TOKEN }}
28-
standard_token: ${{ secrets.GITHUB_TOKEN }}
2928
- uses: ./.github/actions/people
3029
with:
3130
token: ${{ secrets.ACTIONS_TOKEN }}
32-
standard_token: ${{ secrets.GITHUB_TOKEN }}
31+
standard_token: ${{ secrets.FASTAPI_PEOPLE }}

0 commit comments

Comments
 (0)