Skip to content

Commit

Permalink
issue #33: add deployment file
Browse files Browse the repository at this point in the history
  • Loading branch information
vivalareda committed Nov 23, 2023
1 parent 155921c commit f27c11e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/workflow-vercel-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Vercel Preview Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
workflow_call:

permissions:
checks: read
contents: read
pull-requests: write

jobs:
Deploy-Preview-and-Comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}

- name: vercel-preview-url
uses: zentered/vercel-preview-url@v1.0.0
id: vercel_preview_url
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
with:
vercel_team_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID }}

- name: Comment on PR
uses: JoseThen/comment-pr@v1.2.0
with:
comment: ${{ steps.vercel_preview_url.outputs}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f27c11e

Please sign in to comment.