Skip to content

Commit

Permalink
feat: deploy to vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
cqh963852 committed Aug 3, 2023
1 parent df23065 commit 9f6ec33
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI Check

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

on:
pull_request:
branches:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/deploy.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Vercel Preview Deployment

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

on:
pull_request:
branches:
- main

jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Pull Vercel Environment Information
run: yarn dlx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: yarn dlx vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: yarn dlx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Vercel Production Deployment

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

on:
push:
branches:
- main

jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Pull Vercel Environment Information
run: yarn dlx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: yarn dlx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: yarn dlx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ yarn-error.log*
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.vercel
4 changes: 2 additions & 2 deletions apps/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const config = {
favicon: "img/favicon.ico",

// Set the production url of your site here
url: "https://idealjs.github.io/",
url: "https://camphora-styled.idealjs.com/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/camphora",
baseUrl: "/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down
7 changes: 7 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "yarn workspace website build",
"installCommand": "yarn install --immutable",
"framework": "docusaurus-2",
"outputDirectory": "./apps/website/build"
}

1 comment on commit 9f6ec33

@vercel
Copy link

@vercel vercel bot commented on 9f6ec33 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

camphora – ./

camphora-styled.vercel.app
camphora-idealjs.vercel.app
camphora-git-main-idealjs.vercel.app

Please sign in to comment.