From 216894202f43faa551ee1e909300a4ff48c2b477 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sun, 26 Nov 2023 19:50:14 +0200 Subject: [PATCH 1/3] Vercel deploy action (#45) * vercel pr deploy action * Install recent node & pnpm * Comment with vercel deployment URL * Use pull request number (not ID) * add pr permissions * try removing issues permissions * reusable vercel deploy workflow * prod deployment * fix commit link * fix prod deployment name * fix prod deploye config * fix permissions * preview deploy (instead of PR deploy) keep using the app for PR due to better fork PR experience * disable vercel app main prod deployment keep in Github Action --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/preview-deploy.yml | 15 +++++++ .github/workflows/prod-deploy.yml | 22 ++++++++++ .github/workflows/reusable-deploy-vercel.yml | 44 ++++++++++++++++++++ vercel.json | 7 ++++ 4 files changed, 88 insertions(+) create mode 100644 .github/workflows/preview-deploy.yml create mode 100644 .github/workflows/prod-deploy.yml create mode 100644 .github/workflows/reusable-deploy-vercel.yml create mode 100644 vercel.json diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml new file mode 100644 index 00000000..dd8036d2 --- /dev/null +++ b/.github/workflows/preview-deploy.yml @@ -0,0 +1,15 @@ +name: Preview Deployment + +on: workflow_dispatch + +jobs: + deploy: + permissions: + contents: read + + uses: ./.github/workflows/reusable-deploy-vercel.yml + + secrets: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml new file mode 100644 index 00000000..5092c128 --- /dev/null +++ b/.github/workflows/prod-deploy.yml @@ -0,0 +1,22 @@ +name: PROD Deployment + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + deploy: + permissions: + contents: read + + uses: ./.github/workflows/reusable-deploy-vercel.yml + + with: + PROD: true + + secrets: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/reusable-deploy-vercel.yml b/.github/workflows/reusable-deploy-vercel.yml new file mode 100644 index 00000000..fedd2584 --- /dev/null +++ b/.github/workflows/reusable-deploy-vercel.yml @@ -0,0 +1,44 @@ +name: Vercel Deployment (reusable) + +on: + workflow_call: + inputs: + PROD: + required: false + type: boolean + default: false + secrets: + VERCEL_ORG_ID: + required: true + VERCEL_PROJECT_ID: + required: true + VERCEL_TOKEN: + required: true + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + VERCEL_ENVIRONMENT: ${{ inputs.PROD == true && 'production' || 'preview' }} + VERCEL_CLI_ENV_FLAG: ${{ inputs.PROD == true && '--prod' || '' }} + +jobs: + deploy: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install Vercel CLI + run: npm install --global vercel@latest + + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=${{ env.VERCEL_ENVIRONMENT }} --token=${{ secrets.VERCEL_TOKEN }} + + - name: Build Project Artifacts + run: vercel build ${{ env.VERCEL_CLI_ENV_FLAG }} --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy Project Artifacts to Vercel + run: vercel deploy ${{ env.VERCEL_CLI_ENV_FLAG }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..7cfdc799 --- /dev/null +++ b/vercel.json @@ -0,0 +1,7 @@ +{ + "git": { + "deploymentEnabled": { + "main": false + } + } + } \ No newline at end of file From 8a18529707f16713e3bd00aafe66eb40e32db5ed Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sun, 26 Nov 2023 19:57:15 +0200 Subject: [PATCH 2/3] Update README.md (#46) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b72cfc1..da869b2e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ --- ## 📖 **Introduction** - +123 Welcome to a centralized repository of links and resources dedicated to Israel. Utilizing the collaborative power of Git, our goal is to galvanize support for Israel, especially during challenging moments. --- From 57fe1587bd167ec3554f989f63b449da28263511 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Mon, 27 Nov 2023 21:49:44 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da869b2e..3b72cfc1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ --- ## 📖 **Introduction** -123 + Welcome to a centralized repository of links and resources dedicated to Israel. Utilizing the collaborative power of Git, our goal is to galvanize support for Israel, especially during challenging moments. ---