ci) add gitea actions and refresh readme
Some checks failed
PR Checks / lint-test-and-docker-build (pull_request) Failing after 1m42s

This commit is contained in:
2026-02-20 19:58:56 -05:00
parent a348fb034d
commit 0f73be45cb
3 changed files with 156 additions and 19 deletions

View File

@@ -0,0 +1,43 @@
name: Build and Push Image
on:
push:
branches:
- main
env:
REGISTRY_HOST: git.campbellwireless.net
IMAGE_NAME: ${{ github.repository }}
jobs:
docker-build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Compute image tags
id: tags
run: |
echo "sha_short=$(echo '${{ github.sha }}' | cut -c1-12)" >> "$GITHUB_OUTPUT"
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.sha_short }}

View File

@@ -0,0 +1,32 @@
name: PR Checks
on:
pull_request:
jobs:
lint-test-and-docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.3'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Unit tests
run: bun run test
- name: Build app
run: bun run build
- name: Build Docker image
run: docker build --file Dockerfile --tag trips:pr-${{ github.sha }} .

100
README.md
View File

@@ -1,35 +1,97 @@
# sv
# trips
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
A SvelteKit travel planning app for managing trips, travelers, transportation, lodgings, package tours, checklists, and experiences.
## Creating a project
## Tech Stack
If you're seeing this, you've probably already done this step. Congrats!
- SvelteKit + TypeScript
- SQLite (`better-sqlite3`)
- Vitest for unit tests
- ESLint + Prettier for code quality
- Bun for local/deploy build workflows
- Docker multi-stage build for production image
## Features
- Authenticated trip dashboard with upcoming/past trip views
- Trip planning with:
- flights
- private vehicles
- other transportation
- lodgings
- package tours
- checklists
- experiences
- Admin flows for travel reference data and tour operator/tour management
## Local Development
### Requirements
- Bun 1.x
- Node.js 22+ (runtime target)
### Setup
```sh
# create a new project
npx sv create my-app
cp .env.example .env
bun install
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
### Run
```sh
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
bun run dev
```
## Building
To create a production version of your app:
## Quality and Tests
```sh
npm run build
bun run lint
bun run test
bun run check
```
You can preview the production build with `npm run preview`.
## Build and Preview
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
```sh
bun run build
bun run preview
```
## Docker
### Build locally
```sh
docker build -t trips:local .
```
### Run locally
```sh
docker compose up --build
```
The container stores SQLite data at `/data/trips.db` (mounted as the `trips-data` volume in `docker-compose.yml`).
## CI (Gitea Actions)
Workflows live in `.gitea/workflows`:
- `pr-checks.yml`: runs lint, tests, and Docker build on pull requests.
- `main-image.yml`: builds and pushes a Docker image on push to `main`.
### Registry secrets for image publish
Configure these repository secrets in Gitea:
- `REGISTRY_USERNAME`
- `REGISTRY_PASSWORD`
By default, the publish workflow pushes to:
- `git.campbellwireless.net/<owner>/<repo>:latest`
- `git.campbellwireless.net/<owner>/<repo>:<short-sha>`
If your registry host differs, edit `REGISTRY_HOST` in `.gitea/workflows/main-image.yml`.