Compare commits
2 Commits
6d322f2056
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b8a436b91 | |||
| 00405ced78 |
36
.gitea/workflows/commit.yaml
Normal file
36
.gitea/workflows/commit.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Commit
|
||||
|
||||
on:
|
||||
push:
|
||||
# only trigger on branches, not on tags
|
||||
branches: '**'
|
||||
|
||||
jobs:
|
||||
# Job 1: Lint and Test (Type Check)
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 10
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 25
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint (Prettier & ESLint)
|
||||
run: pnpm lint
|
||||
|
||||
- name: Type Check (Svelte Check)
|
||||
# Based on your package.json "check" script
|
||||
run: pnpm check
|
||||
28
.gitea/workflows/pr.yaml
Normal file
28
.gitea/workflows/pr.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: PullRequest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ['main', 'dev']
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
with:
|
||||
config-inline: |
|
||||
[registry."git.schreifuchs.ch"]
|
||||
http = true
|
||||
insecure = true
|
||||
|
||||
- name: login
|
||||
run: docker login -u schreifuchs -p ${{ secrets.REGISTRY_TOKEN }} git.schreifuchs.ch
|
||||
- name: Build and push Docker image
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: 'git.schreifuchs.ch/schreifuchs/aktiteil:pr-${{ github.ref_name }}'
|
||||
29
.gitea/workflows/release.yaml
Normal file
29
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
with:
|
||||
config-inline: |
|
||||
[registry."git.schreifuchs.ch"]
|
||||
http = true
|
||||
insecure = true
|
||||
|
||||
- name: login
|
||||
run: docker login -u schreifuchs -p ${{ secrets.REGISTRY_TOKEN }} git.schreifuchs.ch
|
||||
- name: Build and push Docker image
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: 'git.schreifuchs.ch/schreifuchs/aktiteil:${{ github.ref_name }},git.schreifuchs.ch/schreifuchs/aktiteil:latest'
|
||||
@@ -5,5 +5,8 @@ yarn.lock
|
||||
bun.lock
|
||||
bun.lockb
|
||||
|
||||
# Pipeline
|
||||
.pnpm-store/
|
||||
|
||||
# Miscellaneous
|
||||
/static/
|
||||
|
||||
22
README.md
22
README.md
@@ -1,28 +1,14 @@
|
||||
# Aktiteil
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||
|
||||
## Creating a project
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
|
||||
```sh
|
||||
# create a new project in the current directory
|
||||
npx sv create
|
||||
|
||||
# create a new project in my-app
|
||||
npx sv create my-app
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `pnpm install` ), start a development server:
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
pnpm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
pnpm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
@@ -30,9 +16,7 @@ npm run dev -- --open
|
||||
To create a production version of your app:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kitk/adapters) for your target environment.
|
||||
|
||||
657
pnpm-lock.yaml
generated
657
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import { db } from '$lib/server/db';
|
||||
import { aktis, ratings } from '$lib/server/db/schema';
|
||||
import { error, redirect, type Actions } from '@sveltejs/kit';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { and, eq } from 'drizzle-orm';
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { ensureAuth } from '$lib/auth';
|
||||
import { extractFormData } from '$lib/extractFormData';
|
||||
@@ -56,11 +56,11 @@ export const actions = {
|
||||
|
||||
if (!changeRequest) return error(400);
|
||||
|
||||
const res = await db
|
||||
.insert(aktis)
|
||||
.values({ ...changeRequest, author: user.id, version: akti[0].version + 1 })
|
||||
.returning({ id: aktis.id });
|
||||
await db
|
||||
.update(aktis)
|
||||
.set({ ...changeRequest, version: akti[0].version + 1 })
|
||||
.where(and(eq(aktis.author, user.id), eq(aktis.id, event.params.aktiId)));
|
||||
|
||||
return redirect(303, resolve(`/akti/[aktiId]`, { aktiId: res[0].id }));
|
||||
return redirect(303, resolve(`/akti/[aktiId]`, { aktiId: event.params.aktiId }));
|
||||
}
|
||||
} satisfies Actions;
|
||||
|
||||
Reference in New Issue
Block a user