Skip to content

Conversation

@mariacamilagl
Copy link
Collaborator

Do not deploy netlify on external prs. As requested by @tiangolo

@tiangolo tiangolo merged commit 92016da into fastapi:master Feb 27, 2020
@tiangolo
Copy link
Member

Thanks! 👍

@tiangolo
Copy link
Member

Adding more context about this, FastAPI has been using more Netlify building minutes than the free quota, and Netlify has been charging me for that.

To avoid that cost I set up Netlify deployments using GitHub actions: #983

To deploy, it needs Netlify credentials that are passed as environment variables to the GitHub action. The credentials are stored in GitHub secrets in the repo, but those secrets are not passed to the actions triggered by PRs from forks: https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/td-p/30678

So, currently, there's no way to deploy a preview to Netlify using a simple action like that. Then I modified the action to avoid exiting with an error: nwtgck/actions-netlify#33

And that's the action temporarily used here.

A better future (but more involved) alternative, at least that I can think of now, is to create an action that runs periodically, like https://github.com/tiangolo/issue-manager, and that checks for each open PR, and checks if it already wrote a comment with a Netlify deployment for the latest commit of that PR. If not, it would pull that PR, build it, deploy to Netlify, and add a comment with the deployment. This version would work because it's always running from master, not from a branch in a fork. But it wouldn't be able to use the default triggers (on pull_request, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants