From 8c2452684cc2c2ea19e9538301e88ea0b56b80d8 Mon Sep 17 00:00:00 2001 From: Maxime Costalonga Date: Wed, 15 Jan 2025 14:48:41 +0000 Subject: [PATCH 1/3] maint: add action to build and push docker dev image (#31) * maint: add action to check linting and build and push docker image * sty: fix linting to match standard requirements --- .../workflows/build_push_docker_image.yaml | 41 +++++++++++++++++++ next.config.js | 2 +- .../components/sidebar/FilterDatePicker.jsx | 6 +-- src/utils/settings.js | 4 +- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build_push_docker_image.yaml diff --git a/.github/workflows/build_push_docker_image.yaml b/.github/workflows/build_push_docker_image.yaml new file mode 100644 index 0000000..8775ccf --- /dev/null +++ b/.github/workflows/build_push_docker_image.yaml @@ -0,0 +1,41 @@ +name: Build and push Sedimark marketplace frontend development docker image + +on: + workflow_dispatch: + push: + branches: + - '*' + - '!main' + +jobs: + build-and-push: + runs-on: self-hosted + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install nodejs + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + + - name: Install standardjs + run: | + npm install standard --global + + - name: Standard linting check + run: | + standard + + - name: Kaniko build & push + uses: aevea/action-kaniko@master + with: + image: marketplace-frontend + cache: "true" + tag: development + path: . + debug: true + registry: ghcr.io + password: ${{ secrets.GITHUB_TOKEN }} diff --git a/next.config.js b/next.config.js index 17e9412..9fb0929 100644 --- a/next.config.js +++ b/next.config.js @@ -4,7 +4,7 @@ const nextConfig = { output: 'standalone', env: { BATCH_SIZE: process.env.BATCH_SIZE ?? '40', - CONTRACTS_PAGE_SIZE: process.env.CONTRACTS_PAGE_SIZE ?? '5', + CONTRACTS_PAGE_SIZE: process.env.CONTRACTS_PAGE_SIZE ?? '5' }, async headers () { return [ diff --git a/src/app/dashboard/components/sidebar/FilterDatePicker.jsx b/src/app/dashboard/components/sidebar/FilterDatePicker.jsx index f791e76..1a52225 100644 --- a/src/app/dashboard/components/sidebar/FilterDatePicker.jsx +++ b/src/app/dashboard/components/sidebar/FilterDatePicker.jsx @@ -3,15 +3,15 @@ import { useState } from 'react' /** * Renders a date range picker for filtering contracts. - * + * * - Tracks the selected date range using state (`value`). - * - Ensures the current selection is displayed in the `Datepicker` by passing + * - Ensures the current selection is displayed in the `Datepicker` by passing * the `value` prop; without it, the placeholder is shown instead. */ const FilterDatepicker = () => { const [value, setValue] = useState() - //TODO: FIX -> When passing setValue directly to onchange there are too many re-renders and the app crashes + // TODO: FIX -> When passing setValue directly to onchange there are too many re-renders and the app crashes const handleChange = (value) => { setValue(value) } diff --git a/src/utils/settings.js b/src/utils/settings.js index b5808fc..03015b1 100644 --- a/src/utils/settings.js +++ b/src/utils/settings.js @@ -12,8 +12,8 @@ */ const settings = { batchSize: process.env.BATCH_SIZE ?? 40, - contractsPageSize: process.env.CONTRACTS_PAGE_SIZE ?? 5, - } + contractsPageSize: process.env.CONTRACTS_PAGE_SIZE ?? 5 +} Object.freeze(settings) export default settings From f8b8b7d83d5a8b0263d0a7bafd8c303201813a69 Mon Sep 17 00:00:00 2001 From: Maxime Costalonga Date: Wed, 15 Jan 2025 15:46:11 +0000 Subject: [PATCH 2/3] fix: add write packages permission (#32) * fix: add write packages permission * sty: minor formatting * fix: branch trigger --- .github/workflows/build_push_docker_image.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_push_docker_image.yaml b/.github/workflows/build_push_docker_image.yaml index 8775ccf..bd6a06d 100644 --- a/.github/workflows/build_push_docker_image.yaml +++ b/.github/workflows/build_push_docker_image.yaml @@ -4,12 +4,14 @@ on: workflow_dispatch: push: branches: - - '*' - - '!main' + - "**" + - "!main" jobs: build-and-push: runs-on: self-hosted + permissions: + packages: write steps: - name: Checkout repo From 9576776e6d876edd45deb626532ee3c7aef8ecd0 Mon Sep 17 00:00:00 2001 From: Maxime Costalonga Date: Mon, 20 Jan 2025 15:30:46 +0000 Subject: [PATCH 3/3] fix: build docker image action triggers (#33) --- .github/workflows/build_push_docker_image.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_push_docker_image.yaml b/.github/workflows/build_push_docker_image.yaml index bd6a06d..a9a3d7f 100644 --- a/.github/workflows/build_push_docker_image.yaml +++ b/.github/workflows/build_push_docker_image.yaml @@ -4,8 +4,8 @@ on: workflow_dispatch: push: branches: - - "**" - - "!main" + - '**' + - '!main' jobs: build-and-push: