diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a06b080..d1c0b77 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 \ No newline at end of file + - 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 }} \ 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 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 ```