From 89d93f8a746bb637435ba8ef059799cc3c4b2d9f Mon Sep 17 00:00:00 2001 From: Karla Renata Date: Sat, 4 Jul 2026 11:35:56 -0300 Subject: [PATCH] feat: add CI/CD workflows for landing page deployment and PR review --- .github/workflows/deploy-landing.yml | 79 ++++++++++++++++++++++++++++ .github/workflows/pr-review.yml | 49 +++++++++++++++++ landing/.netlify/netlify.toml | 41 +++++++++++++++ landing/dist/.gitkeep | 0 landing/netlify.toml | 11 ++++ 5 files changed, 180 insertions(+) create mode 100644 .github/workflows/deploy-landing.yml create mode 100644 .github/workflows/pr-review.yml create mode 100644 landing/.netlify/netlify.toml delete mode 100644 landing/dist/.gitkeep create mode 100644 landing/netlify.toml diff --git a/.github/workflows/deploy-landing.yml b/.github/workflows/deploy-landing.yml new file mode 100644 index 0000000..8ffa110 --- /dev/null +++ b/.github/workflows/deploy-landing.yml @@ -0,0 +1,79 @@ +name: Deploy Landing Page + +on: + push: + branches: [main, master] + paths: + - 'landing/**' + - '.github/workflows/deploy-landing.yml' + workflow_dispatch: + +env: + NODE_VERSION: '20' + +jobs: + ci: + name: CI — Test & Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./landing + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + cache-dependency-path: ./landing/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build + run: npm run build + env: + PUBLIC_APP_URL: ${{ secrets.PUBLIC_APP_URL }} + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: landing-dist + path: landing/dist/ + + cd: + name: CD — Deploy to Netlify + needs: ci + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: landing-dist + path: landing/dist/ + + - name: Install Netlify CLI + run: npm install -g netlify-cli + + - name: Deploy to Netlify + run: | + netlify deploy \ + --dir=landing/dist \ + --prod \ + --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} \ + --site=${{ secrets.NETLIFY_SITE_ID }} \ No newline at end of file diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml new file mode 100644 index 0000000..0b4bfae --- /dev/null +++ b/.github/workflows/pr-review.yml @@ -0,0 +1,49 @@ +name: PR Review + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - synchronize + - reopened + - ready_for_review + +concurrency: + group: pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + +jobs: + frontend: + name: Frontend validation + runs-on: ubuntu-latest + + if: github.event.pull_request.draft == false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Run lint + run: bun run lint + + - name: Run typecheck + run: bun run check + + - name: Run tests + run: bun test + + - name: Build application + run: bun run build \ No newline at end of file diff --git a/landing/.netlify/netlify.toml b/landing/.netlify/netlify.toml new file mode 100644 index 0000000..80f2a38 --- /dev/null +++ b/landing/.netlify/netlify.toml @@ -0,0 +1,41 @@ +redirectsOrigin = "config" +plugins = [] +headers = [] + +[functions] + +[functions."*"] + +[build] +publish = "C:\\Users\\karla.rosario_a3data\\OneDrive\\Documentos\\GitHub\\condocombat\\landing\\dist" +publishOrigin = "config" +commandOrigin = "config" +base = "C:\\Users\\karla.rosario_a3data\\OneDrive\\Documentos\\GitHub\\condocombat\\landing" +command = "npm run build" + +[build.environment] +NODE_VERSION = "20" + +[build.processing] + +[build.processing.css] + +[build.processing.html] + +[build.processing.images] + +[build.processing.js] + +[build.services] + +[[redirects]] +from = "/*" +to = "/index.html" +status = 200.0 +force = false + +[redirects.query] + +[redirects.conditions] + +[redirects.headers] \ No newline at end of file diff --git a/landing/dist/.gitkeep b/landing/dist/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/landing/netlify.toml b/landing/netlify.toml new file mode 100644 index 0000000..081b68b --- /dev/null +++ b/landing/netlify.toml @@ -0,0 +1,11 @@ +[build] + command = "npm run build" + publish = "dist" + +[build.environment] + NODE_VERSION = "20" + +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 \ No newline at end of file