From 57f2ad2f3d41da6e527dd84f93c58c4c34018517 Mon Sep 17 00:00:00 2001 From: lukas Date: Thu, 27 Aug 2026 10:46:26 +0200 Subject: [PATCH] wip --- .gitea/workflows/ci.yml | 101 ++++++---------------------------------- 1 file changed, 13 insertions(+), 88 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a43033d..394c807 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,94 +1,19 @@ -name: CI - -on: - pull_request: - branches: ['**'] +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] jobs: - build-and-test: + Explore-Gitea-Actions: runs-on: ubuntu-latest - - services: - postgres: - image: postgres:16-alpine - env: - POSTGRES_USER: steakhouse - POSTGRES_PASSWORD: steakhouse - POSTGRES_DB: steakhouse - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U steakhouse" - --health-interval 5s - --health-timeout 5s - --health-retries 10 - - env: - DATABASE_URL: postgres://steakhouse:steakhouse@localhost:5432/steakhouse - BETTER_AUTH_SECRET: ci-only-secret-not-used-in-production - BETTER_AUTH_URL: http://localhost:4173 - STAFF_SEED_EMAIL: admin@example.com - STAFF_SEED_PASSWORD: ci-only-password-not-used-in-production - RESEND_API_KEY: re_ci_dummy_key - RESERVATIONS_FROM_EMAIL: 'Steakhaus bei Mirko ' - steps: - - name: Checkout + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Type check - run: npx tsc --noEmit - - - name: Check that Drizzle migrations are up to date + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository run: | - npx drizzle-kit generate - if [ -n "$(git status --porcelain drizzle)" ]; then - echo "::error::src/db/schema.ts changed without a matching migration. Run 'npm run db:generate' and commit the result." - git status --porcelain drizzle - git diff drizzle - exit 1 - fi - - - name: Apply migrations - run: npm run db:migrate - - - name: Seed baseline data - run: npm run db:seed - - - name: Build - run: npm run build - - - name: Smoke test the production build - run: | - npx vite preview --port 4173 & - PREVIEW_PID=$! - - for i in $(seq 1 30); do - curl -sf http://localhost:4173/ >/dev/null 2>&1 && break - sleep 1 - done - - check() { - code=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:4173$1") - if [ "$code" != "$2" ]; then - echo "::error::GET $1 returned $code, expected $2" - kill "$PREVIEW_PID" - exit 1 - fi - echo "GET $1 -> $code" - } - - check / 200 - check /staff/login 200 - check /impressum 200 - - kill "$PREVIEW_PID" + ls ${{ gitea.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file