👷 Deploy docs to Cloudflare (#644)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent c030668 · Browse files · 2 files·+48 added−49 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+48 added−49 removed
- other:+48 added−49 removed
Provenance
- Commit
8f98e0d- Tree
0dd67bf- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
c030668
2 files changed+48 added−49 removed
added:.github/workflows/deploy-docs.yml+48 added
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748name: Deploy Docson: workflow_run: workflows: - Build Docs types: - completed
jobs: deploy-docs: runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v3 - name: Clean site run: | rm -rf ./site mkdir ./site - name: Download Artifact Docs id: download uses: dawidd6/action-download-artifact@v2.27.0 with: if_no_artifact_found: ignore github_token: ${{ secrets.GITHUB_TOKEN }} workflow: build-docs.yml run_id: ${{ github.event.workflow_run.id }} name: docs-site path: ./site/ - name: Deploy to Cloudflare Pages if: steps.download.outputs.found_artifact == 'true' id: deploy uses: cloudflare/pages-action@v1 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: typertiangolo 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: Comment Deploy if: steps.deploy.outputs.url != '' uses: ./.github/actions/comment-docs-preview-in-pr with: token: ${{ secrets.GITHUB_TOKEN }} deploy_url: "${{ steps.deploy.outputs.url }}"deleted:.github/workflows/preview-docs.yml-49 removed
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849name: Deploy Docson: workflow_run: workflows: - Build Docs types: - completed
jobs: deploy-docs: runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v3 - name: Clean site run: | rm -rf ./site mkdir ./site - name: Download Artifact Docs id: download uses: dawidd6/action-download-artifact@v2.27.0 with: if_no_artifact_found: ignore github_token: ${{ secrets.GITHUB_TOKEN }} workflow: build-docs.yml run_id: ${{ github.event.workflow_run.id }} name: docs-site path: ./site/ - name: Deploy to Netlify if: steps.download.outputs.found_artifact == 'true' id: netlify uses: nwtgck/actions-netlify@v2.0.0 with: publish-dir: './site' production-deploy: ${{ github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' }} github-token: ${{ secrets.GITHUB_TOKEN }} enable-commit-comment: false env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - name: Comment Deploy if: steps.netlify.outputs.deploy-url != '' uses: ./.github/actions/comment-docs-preview-in-pr with: token: ${{ secrets.GITHUB_TOKEN }} deploy_url: "${{ steps.netlify.outputs.deploy-url }}"