From 260d40ad67369aae36b96e3b9851cdb4b0fbbcc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarno=20Kiesil=C3=A4inen?= Date: Sat, 2 Aug 2025 15:03:34 +0300 Subject: [PATCH 1/2] feat(ci): add Drone CI/CD pipeline for frontend --- .drone.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..596bdb4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,42 @@ +kind: pipeline +type: docker +name: frontend-pipeline + +platform: + os: linux + arch: amd64 + +steps: + - name: lint-frontend + image: node:20-alpine + working_dir: /workspace/frontend + commands: + - npm ci + - npm run lint + volumes: + - name: node_modules + path: /workspace/frontend/node_modules + + - name: build-frontend + image: node:20-alpine + working_dir: /workspace/frontend + commands: + - npm ci + - npm run build + volumes: + - name: node_modules + path: /workspace/frontend/node_modules + depends_on: + - lint-frontend + +volumes: + - name: node_modules + temp: {} + +trigger: + branch: + - main + - develop + event: + - push + - pull_request \ No newline at end of file -- 2.49.1 From c631313ded5f496212c6e01eb6a95c9775e6905a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarno=20Kiesil=C3=A4inen?= Date: Sat, 2 Aug 2025 15:21:00 +0300 Subject: [PATCH 2/2] feat: removed drone and added gitea action --- .drone.yml | 42 ----------------------------- .gitea/workflows/frontend-ci.yml | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 42 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/frontend-ci.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 596bdb4..0000000 --- a/.drone.yml +++ /dev/null @@ -1,42 +0,0 @@ -kind: pipeline -type: docker -name: frontend-pipeline - -platform: - os: linux - arch: amd64 - -steps: - - name: lint-frontend - image: node:20-alpine - working_dir: /workspace/frontend - commands: - - npm ci - - npm run lint - volumes: - - name: node_modules - path: /workspace/frontend/node_modules - - - name: build-frontend - image: node:20-alpine - working_dir: /workspace/frontend - commands: - - npm ci - - npm run build - volumes: - - name: node_modules - path: /workspace/frontend/node_modules - depends_on: - - lint-frontend - -volumes: - - name: node_modules - temp: {} - -trigger: - branch: - - main - - develop - event: - - push - - pull_request \ No newline at end of file diff --git a/.gitea/workflows/frontend-ci.yml b/.gitea/workflows/frontend-ci.yml new file mode 100644 index 0000000..3ea2640 --- /dev/null +++ b/.gitea/workflows/frontend-ci.yml @@ -0,0 +1,46 @@ +name: Frontend CI + +on: + push: + branches: [ main, develop ] + paths: + - 'frontend/**' + pull_request: + branches: [ main, develop ] + paths: + - 'frontend/**' + +jobs: + lint-and-build: + name: Lint and Build Frontend + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + cache-dependency-path: frontend/package-lock.json + + - name: Install dependencies + working-directory: frontend + run: npm ci + + - name: Run ESLint + working-directory: frontend + run: npm run lint + + - name: Build project + working-directory: frontend + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: frontend-build + path: frontend/dist + retention-days: 7 \ No newline at end of file -- 2.49.1