Skip to content

Commit

Permalink
👷 Update deploy-docs.yml configs
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Aug 8, 2024
1 parent 94bacaf commit 2f0c12e
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
deployments: write
issues: write
pull-requests: write
statuses: write

jobs:
deploy-docs:
Expand All @@ -20,6 +21,25 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
- name: Deploy Docs Status Pending
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}

- name: Clean site
run: |
rm -rf ./site
Expand All @@ -43,22 +63,11 @@ jobs:
directory: './site'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
- name: Comment Deploy
if: steps.deploy.outputs.url != ''
run: python ./scripts/comment_docs_deploy_url_in_pr.py
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}

0 comments on commit 2f0c12e

Please sign in to comment.