Skip to content

Commit

Permalink
trying out new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohzk committed Jul 18, 2024
1 parent 1262de9 commit 61dbf68
Show file tree
Hide file tree
Showing 5 changed files with 1,722 additions and 22 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: deploy
on:
pull_request:
workflow_dispatch:
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: pnpm
- run: pnpm install
- run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- run: pnpm vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/vercel-pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: preview
on:
pull_request:
workflow_dispatch:
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
preview:
runs-on: ubuntu-latest
environment:
name: Preview
url: ${{ steps.deploy.outputs.url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: pnpm
- run: pnpm install
- run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
- id: deploy
run: echo "::set-output name=url::$(pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
17 changes: 0 additions & 17 deletions .github/workflows/vercel-pull-request.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"lint-staged": "^15.2.7",
"postcss": "^8.4.33",
"prettier": "^3.3.2",
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.1",
"vercel": "^35.0.3"
},
"lint-staged": {
"*.{js,ts,json,css,scss,md}": [
Expand Down
Loading

0 comments on commit 61dbf68

Please sign in to comment.