Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7c1f0c1
feat: Sentry integration
aramos20 Mar 12, 2026
743f19d
feat: backend ESLint configuration, and a CI/CD pipeline for backend …
aramos20 Mar 12, 2026
5497df3
feat: Add GitHub Actions workflow for CI, security scanning, and Rend…
aramos20 Mar 12, 2026
c938730
feat: Add checks to GitHub Actions workflow
aramos20 Mar 12, 2026
d4f3c62
feat: Add GitHub Actions workflow for backend CI and Render deployment
aramos20 Mar 12, 2026
563015a
feat: Add GitHub Actions workflow for backend CI and deployment to Re…
aramos20 Mar 12, 2026
febd49c
feat: add GitHub Actions workflow for backend CI and Render deployment.
aramos20 Mar 12, 2026
3371541
feat: Add initial Docker setup and API documentation with Swagger.
aramos20 Mar 12, 2026
9c549e5
feat: Add GitHub Actions workflow for CI and deployment to Render.
aramos20 Mar 12, 2026
cf10502
feat: Add GitHub Actions workflow for CI and deployment to Render.
aramos20 Mar 12, 2026
f0448d4
feat: Add GitHub Actions workflow for CI and deployment of the backen…
aramos20 Mar 12, 2026
71b66f1
feat: Add GitHub Actions workflow for backend CI and Render deployment.
aramos20 Mar 12, 2026
097ca9c
feat: Add GitHub Actions workflow for backend CI checks and deploymen…
aramos20 Mar 12, 2026
d3f1c88
feat: Integrate Sentry for error tracking and performance monitoring,…
aramos20 Mar 12, 2026
679bd7b
ci: Add GitHub Actions workflow for backend CI checks and deployment …
aramos20 Mar 12, 2026
8e102f2
feat: Add GitHub Actions workflow for backend CI and Render deploymen…
aramos20 Mar 12, 2026
74f257f
feat: Add GitHub Actions CI/CD pipeline for the backend application, …
aramos20 Mar 12, 2026
c914630
Merge branch 'develop' into feat/monitoring
aramos20 Mar 12, 2026
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
70 changes: 54 additions & 16 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ name: CI and Deploy to Render

on:
push:
branches:
- feat/devops-workflow
- develop
branches: [develop, feat/monitoring]
paths: ["apps/backend/**", ".github/workflows/ci-deploy.yml"]
pull_request:
branches:
- develop
branches: [develop, feat/monitoring]
paths: ["apps/backend/**"]

permissions:
contents: read
security-events: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci-backend:
Expand All @@ -28,6 +35,9 @@ jobs:
cache: 'pnpm'
cache-dependency-path: apps/backend/pnpm-lock.yaml

- name: Install Doppler CLI
uses: dopplerhq/cli-action@v1

- name: Install dependencies
run: |
cd apps/backend
Expand All @@ -39,30 +49,58 @@ jobs:
cd apps/backend
pnpm audit --audit-level=high

- name: Install Doppler CLI
uses: dopplerhq/cli-action@v1
- name: Lint Backend
run: |
cd apps/backend
pnpm lint

- name: Install Snyk CLI
run: pnpm install -g snyk
- name: Generate Prisma Client
run: |
cd apps/backend
pnpm prisma generate

- name: Snyk Security Scan
- name: Run Tests
continue-on-error: true
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
run: |
cd apps/backend
doppler run --project example-project --config prd_rwby -- snyk test --severity-threshold=high
doppler run --project example-project --config prd_rwby -- pnpm test -- --passWithNoTests

- name: Lint Backend
- name: Trivy Security Scan
uses: aquasecurity/trivy-action@master
if: always()
with:
scan-type: 'fs'
scan-ref: 'apps/backend'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
exit-code: '0'

- name: Check Trivy Report exists
id: check_trivy
run: |
cd apps/backend
pnpm lint
if [ -f trivy-results.sarif ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v4
if: steps.check_trivy.outputs.exists == 'true'
with:
sarif_file: 'trivy-results.sarif'

deploy:
needs: ci-backend
if: github.event_name == 'push' && (github.ref == 'refs/heads/feat/devops-workflow' || github.ref == 'refs/heads/develop')
if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feat/monitoring')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Doppler CLI
uses: dopplerhq/cli-action@v1

Expand All @@ -71,4 +109,4 @@ jobs:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
run: |
DEPLOY_HOOK=$(doppler secrets get RENDER_DEPLOY_HOOK_URL --project example-project --config prd_rwby --plain)
curl -sS "$DEPLOY_HOOK"
curl -sS "$DEPLOY_HOOK"
7 changes: 6 additions & 1 deletion apps/backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
DATABASE_URL=
JWT_SECRET=
JWT_SECRET=
DIRECT_URL=
SENTRY_DSN=
SENTRY_ORG=
SENTRY_PROJECT=
SENTRY_AUTH_TOKEN=
6 changes: 6 additions & 0 deletions apps/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ CMD ["pnpm", "run", "dev"]
# Production stage
FROM base AS production

# Argument for Sentry Auth Token (provided by Render during build)
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN

# Install all dependencies to build
RUN pnpm install --frozen-lockfile

Expand All @@ -60,6 +64,8 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=production /app/dist ./dist
# Prisma folder is needed for the client
COPY --from=production /app/prisma ./prisma
# Copy src folder so swagger-jsdoc can read annotations from .ts files in production
COPY --from=production /app/src ./src

# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
Expand Down
4 changes: 3 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "node dist/server.js",
"dev": "nodemon --exec ts-node server.ts",
"build": "tsc",
"build": "tsc && sentry-cli sourcemaps inject --org rwby --project node ./dist && sentry-cli sourcemaps upload --org rwby --project node ./dist",
"test": "vitest",
"test:run": "vitest run",
"test:ui": "vitest --ui",
Expand All @@ -17,6 +17,7 @@
"dependencies": {
"@prisma/adapter-pg": "^7.4.0",
"@prisma/client": "^7.4.0",
"@sentry/node": "^8.26.0",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.8",
"bcrypt": "^6.0.0",
Expand All @@ -34,6 +35,7 @@
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@sentry/cli": "^2.33.1",
"@types/bcrypt": "^6.0.0",
"@types/body-parser": "^1.19.6",
"@types/cors": "^2.8.19",
Expand Down
Loading
Loading