From e9a35510c27ac77962ceac73924be44ecfd0e690 Mon Sep 17 00:00:00 2001 From: Sluijsens <1+sluijsens@noreply@slpsoftware.nl> Date: Fri, 24 Jul 2026 07:48:43 +0200 Subject: [PATCH 1/2] Changes ci cd workflow to separate files --- .gitea/workflows/deploy.yaml | 31 ++++++++++ .gitea/workflows/pipeline.yaml | 110 +++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml create mode 100644 .gitea/workflows/pipeline.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..85d4a32 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,31 @@ +name: Deploy +on: + workflow_call: + inputs: + artifact_name: + required: true + type: string + environment: + required: true + type: string + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact_name }} + path: dist + + # Placeholder deploy step: voor nu wordt dist/ opnieuw gepubliceerd + # als duidelijk benoemde, downloadbare artifact. Zodra de hosting-/ + # upload-methode (FTP/SFTP/anders) vastligt, vervang deze stap door + # de daadwerkelijke upload en kan deze opmerking weg. + - name: Package release artifact + uses: actions/upload-artifact@v4 + with: + name: release-dist + path: dist/ + retention-days: 1 diff --git a/.gitea/workflows/pipeline.yaml b/.gitea/workflows/pipeline.yaml new file mode 100644 index 0000000..b6e24a8 --- /dev/null +++ b/.gitea/workflows/pipeline.yaml @@ -0,0 +1,110 @@ +name: Build, Test and Package Release +on: + workflow_dispatch: {} + pull_request: + types: [opened, synchronize, reopened] + +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Get pnpm store directory + id: pnpm-store + run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + build: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Get pnpm store directory + id: pnpm-store + run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT" + + - name: Restore pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm run build + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + retention-days: 1 + + test: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Get pnpm store directory + id: pnpm-store + run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT" + + - name: Restore pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint + run: pnpm run lint + + - name: Unit tests + run: pnpm run test + + deploy: + needs: [build, test] + if: github.event_name == 'workflow_dispatch' + uses: ./.gitea/workflows/deploy.yaml + with: + artifact_name: dist + environment: production From 3cb50f6f3901b4f8d7c4704eb5b9c6c47dbf521f Mon Sep 17 00:00:00 2001 From: Sluijsens <1+sluijsens@noreply@slpsoftware.nl> Date: Fri, 24 Jul 2026 07:48:58 +0200 Subject: [PATCH 2/2] Delete .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 76 ------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml deleted file mode 100644 index 4d1414a..0000000 --- a/.gitea/workflows/deploy.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Build, Test and Package Release - -# Pipeline (see aidlc-docs/features/react-frontend/operations/deployment/deployment-instructions.md): -# - Runs automatically on every pull request (merge request) as a build/test/lint gate. -# - Can also be triggered manually from Gitea Actions, picking the branch/ref to run against. -# - The "deploy" job currently only packages dist/ as a downloadable artifact -# (no automatic upload to a host yet) and only runs for manual (workflow_dispatch) runs. -# Typically run on a `release/*` branch once you've manually created it for a release. -# - Uploaded artifacts expire after 1 day (retention-days: 1). -# - Gitea Actions has no GitLab/Azure DevOps-style approval gate (a single job with a -# "manual" play button inside an already-running pipeline). The closest equivalent is -# workflow_dispatch: the deploy job only runs when someone presses "Run workflow" in -# the Gitea Actions UI, i.e. a one-click manual approval. - -on: - workflow_dispatch: {} - pull_request: - types: [opened, synchronize, reopened] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Lint - run: pnpm run lint - - - name: Unit tests - run: pnpm run test - - - name: Build - run: pnpm run build - - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/ - retention-days: 1 - - deploy: - needs: build-and-test - if: github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: dist - path: dist - - # Placeholder deploy step: for now this only re-publishes dist/ as a clearly - # named, ready-to-download artifact. Once the hosting/upload method (FTP/SFTP/ - # other) is finalized, replace this step with the actual upload and this - # comment can be removed. - - name: Package release artifact - uses: actions/upload-artifact@v3 - with: - name: release-dist - path: dist/ - retention-days: 1