github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

Vercel maxDuration fix + GH Actions workflow for Vercel deployment

Open Zo-Bro-23 opened this issue 3 years ago β€’ 7 comments

Changed default maxDuration to 10 so that users can easily fork and deploy to Vercel.

Also added a GH Actions workflow that changes maxDuration to 30 so that @anuraghazra can still have 30 for his deployment.

@anuraghazra after merging you have to change Vercel deployment branch from master to vercel.

Zo-Bro-23 avatar Jan 17 '23 07:01 Zo-Bro-23

@Zo-Bro-23 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jan 17 '23 07:01 vercel[bot]

@Zo-Bro-23 thanks for your pr! @anuraghazra this looks like a high quality PR.πŸ‘Œ It will stop people from trying to open maxDurarion PRs which I have to close.

rickstaa avatar Jan 19 '23 06:01 rickstaa

Codecov Report

Base: 96.75% // Head: 96.90% // Increases project coverage by +0.15% :tada:

Coverage data is based on head (d04b114) compared to base (4ff2c2a). Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2424      +/-   ##
==========================================
+ Coverage   96.75%   96.90%   +0.15%     
==========================================
  Files          22       22              
  Lines        3883     3882       -1     
  Branches      329      337       +8     
==========================================
+ Hits         3757     3762       +5     
+ Misses        124      118       -6     
  Partials        2        2              
Impacted Files Coverage Ξ”
src/fetchers/stats-fetcher.js 93.14% <0.00%> (+2.13%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jan 21 '23 11:01 codecov[bot]

@Zo-Bro-23 we need to manually keep the vercel & master branch in sync right?

anuraghazra avatar Jan 21 '23 13:01 anuraghazra

@Zo-Bro-23 we need to manually keep the vercel & master branch in sync right?

Nope! That's what .github/workflows/deploy-prep.yml is for. It checks out the files from the master branch, edits vercel.json, and pushes to the vercel branch πŸŽ‰

Zo-Bro-23 avatar Jan 21 '23 14:01 Zo-Bro-23

@Zo-Bro-23 we need to manually keep the vercel & master branch in sync right?

Nope! That's what .github/workflows/deploy-prep.yml is for. It checks out the files from the master branch, edits vercel.json, and pushes to the vercel branch πŸŽ‰

The logic looks okay to me. However, does it keeps the Public API URL the same? It seems like it would now be on the https://github-readme-stats-vercel.vercel.app endpoint. πŸ€” Is there a way to deploy the changed code to Vercel while keeping the unchanged code in GitHub? Further, doesn't this action get run when people fork the repo? I did not have time to do tests yet, but I just wondered about some things.

rickstaa avatar Jan 21 '23 15:01 rickstaa

@Zo-Bro-23 we need to manually keep the vercel & master branch in sync right?

Nope! That's what .github/workflows/deploy-prep.yml is for. It checks out the files from the master branch, edits vercel.json, and pushes to the vercel branch tada

The logic looks okay to me. However, does it keeps the Public API URL the same? It seems like it would now be on the https://github-readme-stats-vercel.vercel.app endpoint. thinking Is there a way to deploy the changed code to Vercel while keeping the unchanged code in GitHub? Further, doesn't this action get run when people fork the repo? I did not have time to do tests yet, but I just wondered about some things.

The Vercel URL can be changed to anything as long as it is available. Right now since we're using https://github-readme-stats.vercel.app, it will remain that unless we change anything from the Dashboard. You need to go to Vercel, Settings, Git, and select vercel branch instead of master, but this won't change the URL or anything.

Is there a way to deploy the changed code to Vercel while keeping the unchanged code in GitHub?

This is my workaround for that. Feel free to comment if you have any better ideas. Since we can't really push code to Vercel without first pushing to GitHub, I'm basically just keeping a second vercel branch that is an exact copy of the master branch except for vercel.json.

As for the fork, I've added a commit (https://github.com/anuraghazra/github-readme-stats/pull/2424/commits/c766d0b2b3ea5c1d70027976b06ef7e8d36f20a6) that will disable this. Thanks for the idea! So if people fork and deploy, it will by default deploy from the master branch, which will have the correct vercel.json.

Zo-Bro-23 avatar Jan 22 '23 02:01 Zo-Bro-23

@Zo-Bro-23 we need to manually keep the vercel & master branch in sync right?

Nope! That's what .github/workflows/deploy-prep.yml is for. It checks out the files from the master branch, edits vercel.json, and pushes to the vercel branch tada

The logic looks okay to me. However, does it keeps the Public API URL the same? It seems like it would now be on the https://github-readme-stats-vercel.vercel.app endpoint. thinking Is there a way to deploy the changed code to Vercel while keeping the unchanged code in GitHub? Further, doesn't this action get run when people fork the repo? I did not have time to do tests yet, but I just wondered about some things.

The Vercel URL can be changed to anything as long as it is available. Right now since we're using https://github-readme-stats.vercel.app, it will remain that unless we change anything from the Dashboard. You need to go to Vercel, Settings, Git, and select vercel branch instead of master, but this won't change the URL or anything.

Is there a way to deploy the changed code to Vercel while keeping the unchanged code in GitHub?

This is my workaround for that. Feel free to comment if you have any better ideas. Since we can't really push code to Vercel without first pushing to GitHub, I'm basically just keeping a second vercel branch that is an exact copy of the master branch except for vercel.json.

As for the fork, I've added a commit (c766d0b) that will disable this. Thanks for the idea! So if people fork and deploy, it will by default deploy from the master branch, which will have the correct vercel.json.

Cool, I overlooked that setting in the Vercel dashboard. πŸ‘Then your PR looks good to me. Thanks a lot for implementing it. πŸ‘πŸ»

rickstaa avatar Jan 24 '23 14:01 rickstaa