From e245df78a985348a80cb0fc44621730f3fd396eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C4=91elo=20Kandi=C4=87?= Date: Fri, 27 Mar 2026 17:15:20 +0100 Subject: [PATCH] feat: add CI/CD workflows for Cloudflare Pages deployment - ci.yml: build and preview deploy on pull requests - manual.yml: manual production deploy via workflow dispatch - pr.yml: semantic PR title validation --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++ .github/workflows/manual.yml | 50 ++++++++++++++++++++++++++++++++++++ .github/workflows/pr.yml | 23 +++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/manual.yml create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..1586c6477 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: ci + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install deps + run: npm ci + + - name: Build + run: npm run build + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: ./dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: miso-landing-web + url: ${{ steps.deploy-step.outputs.deployment-url }} + outputs: + deployment-url: ${{ steps.deploy-step.outputs.deployment-url }} + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: ./dist + + - name: Deploy preview to Cloudflare Pages + id: deploy-step + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./dist --project-name=miso-landing-web --branch=${{ github.head_ref }} diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 000000000..c06539ac7 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,50 @@ +name: Deploy to Production + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install deps + run: npm ci + + - name: Build + run: npm run build + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: ./dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: miso-landing-web + url: ${{ steps.deploy-step.outputs.deployment-url }} + outputs: + deployment-url: ${{ steps.deploy-step.outputs.deployment-url }} + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: ./dist + + - name: Deploy to Cloudflare Pages + id: deploy-step + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./dist --project-name=miso-landing-web diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..61a69c402 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,23 @@ +name: "Semantic PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + fix + feat + chore + revert