Skip to content

Commit

Permalink
Add workflows to deploy to Vercel (#258)
Browse files Browse the repository at this point in the history
* add automated action for preview

* add workflow for production

* update gitignore
  • Loading branch information
waalbert authored Apr 18, 2024
1 parent 30ccba7 commit 7a0d2af
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Preview

on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>VenusHacks 2024</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_SITE}}
28 changes: 28 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Production

on:
workflow_run:
workflows:
- Run Checks
types:
- completed
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: false
vercel-args: "--prod"
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_SITE}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ next-env.d.ts

# vercel
.vercel
/out

# dependencies
/node_modules
Expand Down

0 comments on commit 7a0d2af

Please sign in to comment.