Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
ENG-594: Vercel CI (#80)
Browse files Browse the repository at this point in the history
* Update vercel env vars & CI flow

* Update to use env var
  • Loading branch information
calummoore authored Apr 20, 2023
1 parent 98492ff commit 29338e6
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .env.development

This file was deleted.

5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REACT_APP_API_URL=https://testnet.polybase.xyz
REACT_APP_DOMAIN=127.0.0.1
REACT_APP_STRIPE_KEY=pk_test_51KtuEsLy2l5dJUizqERWHW5XeSzxFyMB77n9YGWFaznMHEtU9uI9oSC6hXIPH1ZuKhZqyBieTzdlznsm7MsdFB5t00vzGufO1Q
# DO NOT USE THIS PRIVATE KEY IN PRODUCTION, BECAUSE OBV EVERYONE CAN SEE IT
PRIVATE_KEY=012720e1ccf409c5b5a5d51671eaad318aaaa45e7b37fe220b28bb7bc2e6619d
5 changes: 0 additions & 5 deletions .env.production

This file was deleted.

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

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

on:
push:

jobs:
Deploy-Preview:
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 }}
28 changes: 28 additions & 0 deletions .github/workflows/testnet-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Vercel Production Deployment

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

on:
release:
types:
- created

jobs:
Deploy-Production:
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=production --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: 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 @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "explorer",
"name": "@polybase/explorer",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -8,9 +8,11 @@
"test": "react-app-rewired test",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"eject": "react-scripts eject",
"load": "ts-node ./schema/load.ts",
"env": "env-cmd --no-override --file ${ENV_PATH:-.env.development}",
"deploy": "SKIP_PREFLIGHT_CHECK=true NODE_ENV=production yarn build && yarn deploy:netlify",
"pull:dev": "vercel env pull --environment development",
"pull:preview": "vercel env pull --environment preview",
"pull:prod": "vercel env pull --environment production",
"load": "ts-node ./scripts/create-schema.ts",
"env": "env-cmd --no-override --file ${ENV_PATH:-.env}",
"fix": "eslint \"./src/**/*.{ts,tsx}\" webpack.config.js --fix"
},
"dependencies": {
Expand Down Expand Up @@ -169,4 +171,4 @@
"url": "^0.11.0",
"yarn": "^1.22.19"
}
}
}

0 comments on commit 29338e6

Please sign in to comment.