Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Monitorar Aplicação

on:
schedule:
- cron: "*/5 * * * *" # roda a cada 5 minutos
workflow_dispatch: # permite rodar manualmente também

jobs:
monitor:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Criar arquivo de log se não existir
run: |
if [ ! -f monitor.log ]; then
echo "Arquivo de log criado em $(date)" > monitor.log
fi

- name: Monitorar aplicação
run: |
URL="https://spliit-ivory.vercel.app"
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
STATUS=$(curl -s -o /dev/null -w "%{http_code}" $URL)

if [ "$STATUS" == "200" ]; then
echo "$TIMESTAMP - OK (200)" >> monitor.log
else
echo "$TIMESTAMP - ERRO (Status: $STATUS)" >> monitor.log
fi

- name: Salvar log como artefato
uses: actions/upload-artifact@v4
with:
name: monitor-log
path: monitor.log
21 changes: 21 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Scan SonarCloud

on:
push:
branches:
- imsi_action
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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-Production:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install Vercel CLI
run: npm install -g vercel@latest

- name: Pull Vercel Environment
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[<img alt="Spliit" height="60" src="https://github.com/spliit-app/spliit/blob/main/public/logo-with-text.png?raw=true" />](https://spliit.app)

Spliit is a free and open source alternative to Splitwise. You can either use the official instance at [Spliit.app](https://spliit.app), or deploy your own instance:
Spliit is a free and open source alternative to Splitwise. You can either use the official instance at [Spliit.app](https://spliit-git-imsi-action-gabrielrds-projects.vercel.app/), or deploy your own instance:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fspliit-app%2Fspliit&project-name=my-spliit-instance&repository-name=my-spliit-instance&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D&)

Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=gabrielrddev_spliit
sonar.organization=gabrielrddev

# Caminho do código fonte
sonar.sources=src

# Arquivos a excluir
sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/**,**/public/**

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.typescript.tsconfigPath=tsconfig.json