From b2bf4fa4878b585637a7f47d92cb10c62b4d1b06 Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Tue, 24 Jan 2023 20:04:26 +0530 Subject: [PATCH] fix: change prod deployment branch to vercel branch to fix maxDuration bug (#2424) * Create deploy-prep.yml * Create deploy-prep.py * Update vercel.json * Update deploy-prep.yml * Update vercel.json * Added coauthor Co-authored-by: Dou Xiaobo <93511091+douxiaobo@users.noreply.github.com> * Update deploy-prep.yml * refactor: format code * Added if condition to disable deployments on forks Co-authored-by: Rick Staa * Update deploy-prep.yml Co-authored-by: Dou Xiaobo <93511091+douxiaobo@users.noreply.github.com> Co-authored-by: Anurag Hazra Co-authored-by: rickstaa --- .github/workflows/deploy-prep.py | 10 ++++++++++ .github/workflows/deploy-prep.yml | 20 ++++++++++++++++++++ vercel.json | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-prep.py create mode 100644 .github/workflows/deploy-prep.yml diff --git a/.github/workflows/deploy-prep.py b/.github/workflows/deploy-prep.py new file mode 100644 index 0000000..794c19a --- /dev/null +++ b/.github/workflows/deploy-prep.py @@ -0,0 +1,10 @@ +import os + +file = open('./vercel.json', 'r') +str = file.read() +file = open('./vercel.json', 'w') + +str = str.replace('"maxDuration": 10', '"maxDuration": 30') + +file.write(str) +file.close() diff --git a/.github/workflows/deploy-prep.yml b/.github/workflows/deploy-prep.yml new file mode 100644 index 0000000..0626e13 --- /dev/null +++ b/.github/workflows/deploy-prep.yml @@ -0,0 +1,20 @@ +name: Deployment Prep +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + config: + if: github.repository == 'anuraghazra/github-readme-stats' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Deployment Prep + run: python ./.github/workflows/deploy-prep.py + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: vercel + create_branch: true + push_options: "--force" diff --git a/vercel.json b/vercel.json index aee61ce..ddf82eb 100644 --- a/vercel.json +++ b/vercel.json @@ -2,7 +2,7 @@ "functions": { "api/*.js": { "memory": 128, - "maxDuration": 30 + "maxDuration": 10 } }, "redirects": [