Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 #903

Merged
merged 3 commits into from
Jun 8, 2024
Merged

v2 #903

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ indent_size = 2

[*.js]
indent_size = 2

[*.{html,html.j2}]
indent_size = 2
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HTV_BACKEND_PUBLIC_URL=https://localhost/api
HTV_FRONTEND_PUBLIC_URL=https://localhost
CADDY_SITE_ADDRESS=localhost
MEILI_MASTER_KEY=
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
app/tests/data/* linguist-vendored
scrapers/tests/data/* linguist-vendored
backend/tests/scrapers/data/* linguist-vendored
31 changes: 0 additions & 31 deletions .github/dependabot.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Backend CI

on:
push:
branches: ["main"]
pull_request: {}

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./backend

services:
meilisearch:
image: "getmeili/meilisearch:v1.3.1"
ports: ["7700:7700"]
env:
MEILI_MASTER_KEY: "1234567890"

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "poetry"
cache-dependency-path: "./backend/poetry.lock"

- name: Install dependencies
run: poetry install

- name: Check formatting
run: make format-check

- name: Run linter
run: make lint

- name: Run types
run: make typecheck

- name: Run tests
run: make test
env:
HTV_BACKEND_DATABASE_URI: "sqlite:///${{ github.workspace }}/storage/database/database.sqlite3"
HTV_BACKEND_USERS_DATABASE_URI: "sqlite:///${{ github.workspace }}/storage/database/users.sqlite3"
MEILI_MASTER_KEY: "1234567890"
MEILI_URL: "http://localhost:7700"
185 changes: 0 additions & 185 deletions .github/workflows/ci.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Frontend CI

on:
push:
branches: ["main"]
pull_request: {}

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./frontend

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"

- name: Install dependencies
run: npm install

- name: Run linter
run: make lint

- name: Run types
run: make typecheck
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
workflow_dispatch: {}

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest

strategy:
matrix:
image:
- frontend
- backend

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Required to build multi-platform images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Automatically tags Docker images based on Git tags, branches etc.
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-${{ matrix.image }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_STORE
.env
Loading
Loading