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:
push:
branches: [ main ]
branches: [ main, develop ]
jobs:
deploy-frontend:
deploy-staging:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_STAGING }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STAGING }}
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: 🏗 Install Vercel CLI
run: npm install --global vercel@latest
- name: 🏗 Install dependencies
run: npm ci
- name: 🏗 Pull staging app from vercel environment
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }}
- name: 📦 Build app bundle
run: npm run build --if-present
- name: 📦 Build staging app artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
- name: 📦 Deploy to netlify
run: netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --site p2pix --prod
- name: 📦 Deploy staging app artifacts to vercel
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
*.sln
*.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/).
## Project Setup
## Project Setup (with yarn)
```sh
npm install
yarn
```
### Compile and Hot-Reload for Development
```sh
npm run dev
yarn lint
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
yarn build
```
### Lint with [ESLint](https://eslint.org/)
```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
```