change deploy from netlify to vercel
This commit is contained in:
parent
7f385c0bd0
commit
a80585b435
46
.github/workflows/cd.yml
vendored
46
.github/workflows/cd.yml
vendored
@ -1,27 +1,47 @@
|
|||||||
name: Deploy FrontEnd
|
name: Deploy FrontEnd
|
||||||
|
env:
|
||||||
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||||
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main, develop ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-frontend:
|
deploy-preview:
|
||||||
|
if: github.ref == 'refs/heads/develop'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 🏗 Setup repo
|
- name: 🏗 Setup repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 🏗 Setup node
|
- name: 🏗 Install Vercel CLI
|
||||||
uses: actions/setup-node@v3
|
run: npm install --global vercel@latest
|
||||||
with:
|
|
||||||
node-version: 16.x
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: 🏗 Install dependencies
|
- name: 🏗 Pull preview vercel environment
|
||||||
run: npm ci
|
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||||
|
|
||||||
- name: 📦 Build app bundle
|
- name: 📦 Build app artifacts
|
||||||
run: npm run build --if-present
|
run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||||
|
|
||||||
- name: 📦 Deploy to netlify
|
- name: 📦 Deploy preview app artifacts to vercel
|
||||||
run: netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --site p2pix --prod
|
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||||
|
|
||||||
|
deploy-production:
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 🏗 Setup repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: 🏗 Install Vercel CLI
|
||||||
|
run: npm install --global vercel@latest
|
||||||
|
|
||||||
|
- name: 🏗 Pull production vercel environment
|
||||||
|
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||||
|
|
||||||
|
- name: 📦 Build app artifacts
|
||||||
|
run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||||
|
|
||||||
|
- name: 📦 Deploy app artifacts to vercel in production
|
||||||
|
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,3 +26,4 @@ coverage
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
.vercel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user