From 74da7cd6ca2b2cbe30cc537ed6b3add8ca4c2fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 28 Oct 2025 21:09:25 -0300 Subject: [PATCH 01/14] Add Vercel deployment workflow Fix typos and improve the Vercel deployment workflow. --- .github/workflows/vercel-deploy.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/vercel-deploy.yml diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml new file mode 100644 index 00000000..f5e0cca5 --- /dev/null +++ b/.github/workflows/vercel-deploy.yml @@ -0,0 +1,31 @@ +name: Deploy no Vercel + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID}} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID}} + +on: + push: + branches: + - imsi-action + +jobs: + Deploy-Prodution: + runs-on: ubuntu-latest + - name: Checkout + uses: action/checkput@v4 + + - name: Setup Node + uses: actiion/setup-node@v4 + + - name: Install Vercel CLT + run: npm install -g vercel@latest + + - name: Pull Vercel Envirolment + run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} + + - name: Build Artifacts + run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} + + - name: Deploy + run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} From 1c48b03b5d8ef80f4bf95fefb2bf2d9724c2f633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 28 Oct 2025 21:12:44 -0300 Subject: [PATCH 02/14] Update vercel-deploy.yml --- .github/workflows/vercel-deploy.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml index f5e0cca5..31ad0917 100644 --- a/.github/workflows/vercel-deploy.yml +++ b/.github/workflows/vercel-deploy.yml @@ -12,20 +12,20 @@ on: jobs: Deploy-Prodution: runs-on: ubuntu-latest - - name: Checkout - uses: action/checkput@v4 + - name: Checkout + uses: action/checkput@v4 - - name: Setup Node - uses: actiion/setup-node@v4 + - name: Setup Node + uses: actiion/setup-node@v4 - - name: Install Vercel CLT - run: npm install -g vercel@latest + - name: Install Vercel CLT + run: npm install -g vercel@latest - - name: Pull Vercel Envirolment - run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} + - name: Pull Vercel Envirolment + run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} - - name: Build Artifacts - run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} + - name: Build Artifacts + run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} - - name: Deploy - run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} + - name: Deploy + run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} From 34088d3c3eed0ea92a87e175362a594c5d41a1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 28 Oct 2025 21:29:19 -0300 Subject: [PATCH 03/14] Fix indentation and typos in Vercel deploy workflow --- .github/workflows/vercel-deploy.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml index 31ad0917..cb856cde 100644 --- a/.github/workflows/vercel-deploy.yml +++ b/.github/workflows/vercel-deploy.yml @@ -12,20 +12,23 @@ on: jobs: Deploy-Prodution: runs-on: ubuntu-latest - - name: Checkout - uses: action/checkput@v4 + steps: + - name: Checkout + uses: action/checkout@v4 - - name: Setup Node - uses: actiion/setup-node@v4 + - name: Setup Node + uses: actiion/setup-node@v4 + with: + node-version: '18' - - name: Install Vercel CLT - run: npm install -g vercel@latest + - name: Install Vercel CLT + run: npm install -g vercel@latest - - name: Pull Vercel Envirolment - run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} + - name: Pull Vercel Envirolment + run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} - - name: Build Artifacts - run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} + - name: Build Artifacts + run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} - - name: Deploy - run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} + - name: Deploy + run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} From 53aa1da73f3fcf708e237512724992119b6dd619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 28 Oct 2025 21:31:59 -0300 Subject: [PATCH 04/14] Fix typo in deploy command for Vercel --- .github/workflows/vercel-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml index cb856cde..d2704486 100644 --- a/.github/workflows/vercel-deploy.yml +++ b/.github/workflows/vercel-deploy.yml @@ -31,4 +31,4 @@ jobs: run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} - name: Deploy - run: vercel deploy --prebult --prod --token=${{secrets.VERCEL_TOKEN}} + run: vercel deploy --prebuilt --prod --token=${{secrets.VERCEL_TOKEN}} From 3cabaaa05e45b62ac9f39183907c6f3052400a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 28 Oct 2025 21:37:47 -0300 Subject: [PATCH 05/14] Fix typos in Vercel deployment workflow --- .github/workflows/vercel-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml index d2704486..53688a5c 100644 --- a/.github/workflows/vercel-deploy.yml +++ b/.github/workflows/vercel-deploy.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: action/checkout@v4 + uses: actions/checkout@v4 - name: Setup Node - uses: actiion/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: '18' @@ -25,7 +25,7 @@ jobs: run: npm install -g vercel@latest - name: Pull Vercel Envirolment - run: Vercel pull --yes --envirolment=prodution --token=${{secrets.VERCEL_TOKEN}} + run: vercel pull --yes --environment=production --token=${{secrets.VERCEL_TOKEN}} - name: Build Artifacts run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} From a4ba67dbce02823fcc4e9ddbfb0a10add509c7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 20:08:22 -0300 Subject: [PATCH 06/14] Add SonarQube configuration for Spliit project --- .../spliit/.github /sonar-project.properties | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/spliit/.github /sonar-project.properties diff --git a/.github/spliit/.github /sonar-project.properties b/.github/spliit/.github /sonar-project.properties new file mode 100644 index 00000000..22fab852 --- /dev/null +++ b/.github/spliit/.github /sonar-project.properties @@ -0,0 +1,18 @@ +# Substitua pelos valores que você anotou no Passo 1.3 +sonar.projectKey=seu-usuario_spliit +sonar.organization=seu-usuario + +# Configuração do projeto Spliit +sonar.sources=src +sonar.tests=src +sonar.test.inclusions=**/*.test.ts,**/*.test.tsx,**/*.spec.ts + +# Arquivos a excluir da análise +sonar.exclusions=**/node_modules/**,**/dist/**,**/.next/**,**/coverage/**,**/public/**,**/*.config.js,**/*.config.ts + +# Configuração de encoding e TypeScript +sonar.sourceEncoding=UTF-8 +sonar.typescript.tsconfigPath=tsconfig.json + +# Cobertura de testes (se tiver) +sonar.javascript.lcov.reportPaths=coverage/lcov.info From 5bbea8a7d3e03cbde0cabfb7e5b4114a637afe74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 20:09:46 -0300 Subject: [PATCH 07/14] Add SonarCloud analysis workflow for code quality --- .github/workflows/sonar.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 00000000..cc465c70 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,43 @@ +name: Análise SonarCloud + +# Quando esse workflow vai executar +on: + # Em pull requests para o branch imsi-action + pull_request: + branches: + - imsi-action + types: [opened, synchronize, reopened] + + # Em push direto no branch imsi-action + push: + branches: + - imsi-action + +jobs: + analise-codigo: + name: Análise de Qualidade de Código + runs-on: ubuntu-latest + + steps: + # Passo 1: Baixar o código do repositório + - name: Checkout do código + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Baixa todo histórico (necessário para análise) + + # Passo 2: Configurar Node.js (Spliit usa TypeScript/Node) + - name: Configurar Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + # Passo 3: Instalar dependências + - name: Instalar dependências + run: npm ci + + # Passo 4: Executar análise do SonarCloud + - name: Análise SonarCloud + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Token automático do GitHub + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Token que você configurou From 2b352b4f70e524f6a1440444d30deee7c3c74051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 20:51:37 -0300 Subject: [PATCH 08/14] Add sonar-project.properties for SonarQube configuration --- sonar-project.properties | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..22fab852 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,18 @@ +# Substitua pelos valores que você anotou no Passo 1.3 +sonar.projectKey=seu-usuario_spliit +sonar.organization=seu-usuario + +# Configuração do projeto Spliit +sonar.sources=src +sonar.tests=src +sonar.test.inclusions=**/*.test.ts,**/*.test.tsx,**/*.spec.ts + +# Arquivos a excluir da análise +sonar.exclusions=**/node_modules/**,**/dist/**,**/.next/**,**/coverage/**,**/public/**,**/*.config.js,**/*.config.ts + +# Configuração de encoding e TypeScript +sonar.sourceEncoding=UTF-8 +sonar.typescript.tsconfigPath=tsconfig.json + +# Cobertura de testes (se tiver) +sonar.javascript.lcov.reportPaths=coverage/lcov.info From 88ec94b0ae393069b7e7c020cfca9ca4b6cd8d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 20:53:11 -0300 Subject: [PATCH 09/14] Add GitHub Actions workflow for automatic deployment This workflow automates the deployment process, including code analysis and Docker image building. --- .github/workflows/deploy.yml | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..ee3f6390 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,75 @@ +name: Deploy Automático + +# Esse workflow executa APENAS quando há merge no branch imsi-action +on: + push: + branches: + - imsi-action + +jobs: + # Job 1: Análise de código (roda primeiro) + analise: + name: Verificação de Qualidade + runs-on: ubuntu-latest + + steps: + - name: Checkout do código + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configurar Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Instalar dependências + run: npm ci + + - name: Análise SonarCloud + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + # Job 2: Build e Deploy (só roda se a análise passar) + build-and-deploy: + name: Build e Deploy da Aplicação + needs: analise # Espera o job 'analise' terminar com sucesso + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login no GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Configurar QEMU + uses: docker/setup-qemu-action@v3 + + - name: Configurar Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Converter nome do repositório para minúsculas + run: | + echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}" + + - name: Build e Push da imagem Docker + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ env.REPO }}:latest + ghcr.io/${{ env.REPO }}:${{ github.sha }} + provenance: false + sbom: false From 8ef5c7e3164f3930b76561060aab559cde326677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 21:16:40 -0300 Subject: [PATCH 10/14] Refactor SonarCloud workflow for clarity --- .github/workflows/sonar.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index cc465c70..3d4fc48d 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,14 +1,11 @@ name: Análise SonarCloud -# Quando esse workflow vai executar on: - # Em pull requests para o branch imsi-action pull_request: branches: - imsi-action types: [opened, synchronize, reopened] - # Em push direto no branch imsi-action push: branches: - imsi-action @@ -19,25 +16,22 @@ jobs: runs-on: ubuntu-latest steps: - # Passo 1: Baixar o código do repositório - name: Checkout do código uses: actions/checkout@v4 with: - fetch-depth: 0 # Baixa todo histórico (necessário para análise) + fetch-depth: 0 - # Passo 2: Configurar Node.js (Spliit usa TypeScript/Node) - name: Configurar Node.js uses: actions/setup-node@v4 with: node-version: '20' + cache: 'npm' - # Passo 3: Instalar dependências - name: Instalar dependências run: npm ci - # Passo 4: Executar análise do SonarCloud - name: Análise SonarCloud uses: SonarSource/sonarcloud-github-action@master env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Token automático do GitHub - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Token que você configurou + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From dcb46b3cf95116fb615132c63be13fc3fcea8031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 21:28:15 -0300 Subject: [PATCH 11/14] Delete .github/workflows/deploy.yml --- .github/workflows/deploy.yml | 75 ------------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index ee3f6390..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Deploy Automático - -# Esse workflow executa APENAS quando há merge no branch imsi-action -on: - push: - branches: - - imsi-action - -jobs: - # Job 1: Análise de código (roda primeiro) - analise: - name: Verificação de Qualidade - runs-on: ubuntu-latest - - steps: - - name: Checkout do código - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configurar Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Instalar dependências - run: npm ci - - - name: Análise SonarCloud - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - # Job 2: Build e Deploy (só roda se a análise passar) - build-and-deploy: - name: Build e Deploy da Aplicação - needs: analise # Espera o job 'analise' terminar com sucesso - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Login no GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Configurar QEMU - uses: docker/setup-qemu-action@v3 - - - name: Configurar Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Converter nome do repositório para minúsculas - run: | - echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}" - - - name: Build e Push da imagem Docker - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ghcr.io/${{ env.REPO }}:latest - ghcr.io/${{ env.REPO }}:${{ github.sha }} - provenance: false - sbom: false From bf2adf5ce7e87a5c6eb5352488be8dbadc76b217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 21:37:04 -0300 Subject: [PATCH 12/14] Refactor SonarCloud workflow configuration Updated SonarCloud workflow to include main branch and renamed job. --- .github/workflows/sonar.yml | 38 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 3d4fc48d..ae75a485 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,37 +1,21 @@ -name: Análise SonarCloud +name: Scan SonarCloud on: - pull_request: - branches: - - imsi-action - types: [opened, synchronize, reopened] - push: branches: - - imsi-action - + - main + pull_request: + types: [opened, synchronize, reopened] + jobs: - analise-codigo: - name: Análise de Qualidade de Código + sonarqube: + name: SonarQube runs-on: ubuntu-latest - steps: - - name: Checkout do código - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configurar Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 with: - node-version: '20' - cache: 'npm' - - - name: Instalar dependências - run: npm ci - - - name: Análise SonarCloud - uses: SonarSource/sonarcloud-github-action@master + fetch-depth: 0 + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v6 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From baec170b345b894d40c089cc1345cc47090cf025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Fri, 14 Nov 2025 21:46:30 -0300 Subject: [PATCH 13/14] Change SonarQube project key and organization Updated project key and organization for SonarQube. --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 22fab852..9b42e9a3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ # Substitua pelos valores que você anotou no Passo 1.3 -sonar.projectKey=seu-usuario_spliit -sonar.organization=seu-usuario +sonar.projectKey=joao-stempniak_spliit +sonar.organization=joao-stempniak # Configuração do projeto Spliit sonar.sources=src From dbb59fa292aae3d2828e68b293dac3e14019102e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 18 Nov 2025 19:32:09 -0300 Subject: [PATCH 14/14] Fix indentation in Vercel deploy workflow --- .github/workflows/vercel-deploy.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml index 53688a5c..45d666c9 100644 --- a/.github/workflows/vercel-deploy.yml +++ b/.github/workflows/vercel-deploy.yml @@ -1,13 +1,15 @@ name: Deploy no Vercel -env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID}} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID}} - on: push: branches: - imsi-action + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID}} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID}} + + jobs: Deploy-Prodution: