diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d5ed451 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +KOITO_ALLOWED_HOSTS=* +KOITO_LOG_LEVEL=debug +KOITO_CONFIG_DIR=test_config_dir +KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5432?sslmode=disable +TZ=Etc/UTC diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..fbf205d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +ko_fi: gabehf diff --git a/.github/workflows/astro.yml b/.github/workflows/astro.yml index 2da5fc4..428b7b8 100644 --- a/.github/workflows/astro.yml +++ b/.github/workflows/astro.yml @@ -2,10 +2,13 @@ name: Deploy to GitHub Pages on: push: - branches: [main] + tags: + - "v*" paths: - - 'docs/**' - - '.github/workflows/**' + - "docs/**" + - ".github/workflows/**" + + workflow_dispatch: permissions: contents: read @@ -21,9 +24,9 @@ jobs: - name: Install, build, and upload your site output uses: withastro/action@v4 with: - path: ./docs # The root location of your Astro project inside the repository. (optional) - node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 22. (optional) - package-manager: yarn@1.22.22 # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + path: ./docs # The root location of your Astro project inside the repository. (optional) + node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 22. (optional) + package-manager: yarn@1.22.22 # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) deploy: needs: build @@ -34,4 +37,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 95d893e..466a4f6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,6 +17,7 @@ on: - main paths-ignore: - "docs/**" + - "README.md" workflow_dispatch: diff --git a/.gitignore b/.gitignore index bade026..083bb78 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ test_config_dir +.env diff --git a/Makefile b/Makefile index fbca22e..99455ac 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +ifneq (,$(wildcard ./.env)) + include .env + export +endif + .PHONY: all test clean client postgres.schemadump: @@ -10,7 +15,7 @@ postgres.schemadump: -v --dbname="koitodb" -f "/tmp/dump/schema.sql" postgres.run: - docker run --name koito-db -p 5432:5432 -e POSTGRES_PASSWORD=secret -d postgres + docker run --name koito-db -p 5432:5432 -v koito_dev_db:/var/lib/postgresql -e POSTGRES_PASSWORD=secret -d postgres postgres.run-scratch: docker run --name koito-scratch -p 5433:5432 -e POSTGRES_PASSWORD=secret -d postgres @@ -28,10 +33,10 @@ postgres.remove-scratch: docker stop koito-scratch && docker rm koito-scratch api.debug: postgres.start - KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5432?sslmode=disable go run cmd/api/main.go + go run cmd/api/main.go api.scratch: postgres.run-scratch - KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir/scratch KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5433?sslmode=disable go run cmd/api/main.go + KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5433?sslmode=disable go run cmd/api/main.go api.test: go test ./... -timeout 60s diff --git a/README.md b/README.md index 2bc10ce..b51b2ff 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,21 @@ -# Koito +