From e3727d0422928ee8ec11ef4f04d9a64b27a1e795 Mon Sep 17 00:00:00 2001 From: Liam Pietralla Date: Fri, 29 Aug 2025 12:06:25 +1000 Subject: [PATCH 1/4] add ci --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cfb207f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: Build and Push Container + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + workflow_dispatch: + +jobs: + build: + name: Build App + runs-on: ubuntu-latest + defaults: + run: + working-directory: applications/sole-invoice-web + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Install Dependencies + run: pnpm i --frozen-lockfile + + - name: Build App + run: pnpm run build + + publish: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + name: Publish App + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Docker Metadata + uses: docker/metadata-action@v5 + id: metadata + with: + images: liamsgit.dev/LiamPietralla/liam-portfolio + tags: | + type=raw,value=latest + + - name: Login To Docker Registry + uses: docker/login-action@v3 + with: + registry: liamsgit.dev + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Push Image + uses: docker/build-push-action@v6 + with: + file: Dockerfile + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + -- 2.49.1 From 8a3c5ed22af0e3b88fc060c3b19605efb87d2215 Mon Sep 17 00:00:00 2001 From: Liam Pietralla Date: Fri, 29 Aug 2025 12:07:15 +1000 Subject: [PATCH 2/4] ci: remove pnpm version --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfb207f..4d52bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,6 @@ jobs: - name: Setup PNPM uses: pnpm/action-setup@v4 - with: - version: 10 - name: Install Dependencies run: pnpm i --frozen-lockfile -- 2.49.1 From 7809e137b0eb5c95b12770e9a19191311c107ce6 Mon Sep 17 00:00:00 2001 From: Liam Pietralla Date: Fri, 29 Aug 2025 12:08:14 +1000 Subject: [PATCH 3/4] ci: fix work dir --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d52bab..c759021 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,6 @@ jobs: build: name: Build App runs-on: ubuntu-latest - defaults: - run: - working-directory: applications/sole-invoice-web steps: - name: Checkout Repo -- 2.49.1 From 8085eeb1107417abd80a33ce0c61584b0d941d2d Mon Sep 17 00:00:00 2001 From: Liam Pietralla Date: Fri, 29 Aug 2025 12:12:07 +1000 Subject: [PATCH 4/4] build: convert require to import --- src/app/api/health/route.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/api/health/route.ts b/src/app/api/health/route.ts index 20918e3..32aafe5 100644 --- a/src/app/api/health/route.ts +++ b/src/app/api/health/route.ts @@ -1,9 +1,10 @@ +import pkg from "../../../../package.json"; + export async function GET() { - const json = require("../../../../package.json"); const response = { "status": "Healthy", - "version": json.version - } + "version": pkg.version + }; return new Response(JSON.stringify(response), { status: 200, headers: { -- 2.49.1