Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Deployment

on: [pull_request, workflow_dispatch]

jobs:
deploy:
permissions:
contents: read
pull-requests: write

uses: ./.github/workflows/reusable-deploy-vercel.yml

with:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

secrets:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}
65 changes: 65 additions & 0 deletions .github/workflows/reusable-deploy-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Vercel Deployment (reusable)

on:
workflow_call:
inputs:
COMMIT_SHA:
required: false
type: string
PULL_REQUEST_NUMBER:
required: false
type: number
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 }} > /tmp/vercel-deployment-url.txt

- name: Generate PR comment
if: ${{ inputs.PULL_REQUEST_NUMBER != 0 }}
uses: actions/github-script@v7
with:
script: |
const fsAsync = require("fs").promises;
const deploymentUrl = await fsAsync.readFile("/tmp/vercel-deployment-url.txt", "utf8");

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.PULL_REQUEST_NUMBER }},
body: `Version ${{ inputs.COMMIT_SHA }} deployed to Vercel: ${deploymentUrl}`
});
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---
Expand Down