Merge pull request #2 from liftlearning/vercel-deploy

Vercel deploy
This commit is contained in:
Ronyell Henrique 2022-10-28 20:47:03 -03:00 committed by GitHub
commit ca419792ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 18 deletions

View File

@ -2,26 +2,49 @@ name: Deploy FrontEnd
on: on:
push: push:
branches: [ main ] branches: [ main, develop ]
jobs: jobs:
deploy-frontend: deploy-staging:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_STAGING }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STAGING }}
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 staging app from vercel environment
run: npm ci run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }}
- name: 📦 Build app bundle - name: 📦 Build staging app artifacts
run: npm run build --if-present run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
- name: 📦 Deploy to netlify - name: 📦 Deploy staging app artifacts to vercel
run: netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --site p2pix --prod run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
deploy-production:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
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
View File

@ -26,3 +26,4 @@ coverage
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
.vercel

View File

@ -21,26 +21,37 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a
See [Vite Configuration Reference](https://vitejs.dev/config/). See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup ## Project Setup (with yarn)
```sh ```sh
npm install yarn
``` ```
### Compile and Hot-Reload for Development ### Compile and Hot-Reload for Development
```sh ```sh
npm run dev yarn lint
``` ```
### Type-Check, Compile and Minify for Production ### Type-Check, Compile and Minify for Production
```sh ```sh
npm run build yarn build
``` ```
### Lint with [ESLint](https://eslint.org/) ### Lint with [ESLint](https://eslint.org/)
```sh ```sh
npm run lint yarn lint
```
## Project Setup (with docker-compose)
### Dependencies
1. Install [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/);
2. Install [Docker Compose](https://docs.docker.com/compose/install/).
### In the main project folder, build and start the application with the command:
```sh
docker-compose up
``` ```