Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add instant docs deploy previews for PRs from forks #2244

Merged
merged 4 commits into from
Oct 25, 2020

Conversation

tiangolo
Copy link
Member

✨ Add instant docs deploy previews for PRs from forks.

This uses the new GitHub Actions event workflow_run.

The GitHub Action event is currently not very well documented, and it ended up requiring a new custom action to extract the original PR for that docs deployment. But this should help with previews for changes in docs (e.g. translations). Instead of the current workaround of previews triggered every hour, this should have a preview in a comment ready in about 1 minute.

@codecov
Copy link

codecov bot commented Oct 25, 2020

Codecov Report

Merging #2244 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2244   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          239       239           
  Lines         7079      7079           
=========================================
  Hits          7079      7079           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 612d114...800e26d. Read the comment docs.

@github-actions
Copy link
Contributor

@tiangolo tiangolo merged commit 4e74d40 into master Oct 25, 2020
@tiangolo tiangolo deleted the fork-deploy-previews branch October 25, 2020 17:54
@adriangb
Copy link
Contributor

Hey @tiangolo, I was able to get this to work using pure workflows (here and here) and some existing actions. Not that this is any better than what you've got, just sharing options 😄

The main thing that helped in figuring out the workflow_run event (which as you say, isn't very well documented) is that you can do echo ${{ toJSON(github.event.workflow_run) }} to get all of the key/values in there.

@tiangolo
Copy link
Member Author

Thanks @adriangb! Very interesting! 🤓

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.

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.

None yet

2 participants