Browse Source

👷 Deploy docs to Cloudflare Pages (#9978)

pull/9982/head
Sebastián Ramírez 2 years ago
committed by GitHub
parent
commit
d2169fbad9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      .github/workflows/deploy-docs.yml

23
.github/workflows/deploy-docs.yml

@ -29,21 +29,20 @@ jobs:
run_id: ${{ github.event.workflow_run.id }} run_id: ${{ github.event.workflow_run.id }}
name: docs-site name: docs-site
path: ./site/ path: ./site/
- name: Deploy to Netlify - name: Deploy to Cloudflare Pages
if: steps.download.outputs.found_artifact == 'true' if: steps.download.outputs.found_artifact == 'true'
id: netlify id: deploy
uses: nwtgck/[email protected] uses: cloudflare/pages-action@v1
with: with:
publish-dir: './site' apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
production-deploy: ${{ github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
github-token: ${{ secrets.FASTAPI_PREVIEW_DOCS_NETLIFY }} projectName: fastapitiangolo
enable-commit-comment: false directory: './site'
env: gitHubToken: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_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 ) }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Comment Deploy - name: Comment Deploy
if: steps.netlify.outputs.deploy-url != '' if: steps.deploy.outputs.url != ''
uses: ./.github/actions/comment-docs-preview-in-pr uses: ./.github/actions/comment-docs-preview-in-pr
with: with:
token: ${{ secrets.FASTAPI_PREVIEW_DOCS_COMMENT_DEPLOY }} token: ${{ secrets.FASTAPI_PREVIEW_DOCS_COMMENT_DEPLOY }}
deploy_url: "${{ steps.netlify.outputs.deploy-url }}" deploy_url: "${{ steps.deploy.outputs.url }}"

Loading…
Cancel
Save