From 3bf97659171e49dda78bc6f59c012e458580422c Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 3 Sep 2026 17:04:28 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20gebruik=20offici=C3=ABle=20checkout=20ac?= =?UTF-8?q?tie=20ipv=20lokaal=20pad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 73 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 00000000..657df6be --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,73 @@ +name: CI +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + check: + if: startsWith(gitea.ref_name, 'v') == false + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + repository: ${{ gitea.repository }} + token: ${{ gitea.token }} + fetch-depth: 50 + + - name: Typecheck, lint, and test + run: | + set -e + echo "--- CI checks starten ---" + node scripts/check-node-toolchain.mjs + + export SKIP_ENV_VALIDATION=1 + export NODE_ENV=test + export DATABASE_URL="mysql://test:test@localhost:3306/test?charset=utf8mb4" + export AUTH_SECRET="ci-test-secret-key-that-is-long-enough" + export REDIS_URL="redis://127.0.0.1:6379?connect_timeout=1" + export BCRYPT_ROUNDS=4 + + pnpm install --frozen-lockfile + pnpm biome:lint + pnpm typecheck + pnpm test + pnpm knip + echo "--- CI checks passed ---" + + deploy: + needs: check + if: gitea.event_name == 'push' && gitea.ref_name == 'main' + runs-on: ubuntu-latest + steps: + - name: Check out repository code for deploy + uses: actions/checkout@v4 + with: + repository: ${{ gitea.repository }} + token: ${{ gitea.token }} + + - name: Build and Deploy Container + run: | + set -e + echo "--- Start Docker Build & Deploy ---" + + docker build -t epicnext-cms:latest . + + docker stop epicnext-cms-app 2>/dev/null || true + docker rm epicnext-cms-app 2>/dev/null || true + + docker run -d \ + --name epicnext-cms-app \ + --restart always \ + --net=host \ + epicnext-cms:latest + + docker image prune -f + echo "--- Deployment succesvol afgerond! ---"