From a80585b435d8e201f19b28dcfdd83689e0c800c7 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Fri, 28 Oct 2022 16:54:14 -0300 Subject: [PATCH 1/3] change deploy from netlify to vercel --- .github/workflows/cd.yml | 46 ++++++++++++++++++++++++++++------------ .gitignore | 1 + 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a06b080..6b8e338 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,27 +1,47 @@ name: Deploy FrontEnd +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: push: - branches: [ main ] + branches: [ main, develop ] jobs: - deploy-frontend: + deploy-preview: + if: github.ref == 'refs/heads/develop' runs-on: ubuntu-latest 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 preview vercel environment + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_AUTH_TOKEN }} - - name: 📦 Build app bundle - run: npm run build --if-present + - name: 📦 Build app artifacts + run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }} - - name: 📦 Deploy to netlify - run: netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --site p2pix --prod \ No newline at end of file + - name: 📦 Deploy preview app artifacts to vercel + 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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 38adffa..dbad7b9 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ coverage *.njsproj *.sln *.sw? +.vercel From 70d3162146644c402dde3b308f99a1d857681f8c Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Fri, 28 Oct 2022 17:04:46 -0300 Subject: [PATCH 2/3] update README to include docker-compose run --- README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 998097c..909dd1d 100644 --- a/README.md +++ b/README.md @@ -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 ``` From 87db689ec132475cfa1ddb1e0466a3d879d43759 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Fri, 28 Oct 2022 19:51:50 -0300 Subject: [PATCH 3/3] change staging deploy to modify url from this environment --- .github/workflows/cd.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6b8e338..d1c0b77 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,16 +1,16 @@ name: Deploy FrontEnd -env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: push: branches: [ main, develop ] jobs: - deploy-preview: + 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 @@ -18,18 +18,21 @@ jobs: - name: 🏗 Install Vercel CLI run: npm install --global vercel@latest - - name: 🏗 Pull preview vercel environment - run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_AUTH_TOKEN }} + - name: 🏗 Pull staging app from vercel environment + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }} - - name: 📦 Build app artifacts - run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }} + - name: 📦 Build staging app artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }} - - name: 📦 Deploy preview app artifacts to vercel - run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_AUTH_TOKEN }} + - 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