Skip to content

Commit

Permalink
merge staging (#294)
Browse files Browse the repository at this point in the history
* chore: add uptime robot link

* feat: add queue and clean up (#286)

* feat: add queue and clean up

* feat: add chapters generation and merge backend app with frontend

* chore: add chapter generation

* chore: merge admin with frontend server (#287)

* feat: add edit chapters

* chore: add ffmpeg to runner container

* chore: add health check

* chore: update playwright

* feat: migration to pnpm

* fix: playwright e2e

* fix: add pnpm action

* fix: add pnpm action

* fix: upgrade playwright

* feat: add chapter form

* fix: add migration

* chore: update theme

* feat: add conception migration

* feat: better-auth migration (#291)

* feat: better-auth migration

* feat: fix better auth migration

* feat: update authentification and fix chapters generation

* chore: update docker config

* chore(ci): update .env

* chore(ci): update github workflow

* fix: re-create db migration

* fix: update migration

* fix: smtp config

* chore(ci): clean up

* chore(ci): update static files

* chore: fix translations

* chore: update github workflow

* chore: enable manual

* chore: update github workflow

* chore: update github workflow

* chore: fix better auth migration

* chore: update github actions

* fix: add emotion auto detection

* feat: add project stats

* chore: add es translation

* chore: add es translation
  • Loading branch information
younes200 authored Jan 13, 2025
1 parent a6833b1 commit e4d064a
Show file tree
Hide file tree
Showing 199 changed files with 31,652 additions and 29,300 deletions.
9 changes: 4 additions & 5 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
NODE_ENV=test

CI_TEST=true
API_URL=http://localhost:2021/trpc

# Cookie secret key. Generate something random and long.
DATABASE_URL=postgres://postgres:postgres@postgres:5432/celluloid
DATABASE_URL=postgres://postgres:postgres@postgres:5432/espectateur
REDIS_URL=redis://redis

COOKIE_SECRET=cisecret3
COOKIE_DOMAIN=localhost
COOKIE_SECURE=false
BETTER_AUTH_SECRET=cisecret3
BASE_URL=http://localhost:3000



# email params. Check with your SMTP provider
Expand Down
4 changes: 0 additions & 4 deletions .git-crypt/.gitattributes

This file was deleted.

Binary file not shown.
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Docker Build

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [staging, main]
workflow_dispatch:
inputs:
tag:
description: "Docker tag"
required: true
default: "latest"

jobs:
build-containers:
Expand All @@ -32,12 +34,12 @@ jobs:
- name: Build
uses: docker/build-push-action@v3
with:
file: Dockerfile.compact
file: ./Dockerfile
context: .
push: true
tags: ghcr.io/${{ github.repository }}/compact:${{ github.event.inputs.tag }}
tags: ghcr.io/${{ github.repository }}/espectateur:${{github.ref_name}}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
API_URL=/trpc
52 changes: 37 additions & 15 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: E2E Tests

# Add concurrency group to cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [staging]
workflow_dispatch:

jobs:
tests:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.39.0-jammy
image: mcr.microsoft.com/playwright:v1.48.2-jammy

services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: celluloid
POSTGRES_DB: espectateur
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
Expand All @@ -39,18 +39,40 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Use Node.js
uses: actions/setup-node@v3
- name: Cache turbo build setup
uses: actions/cache@v4
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- run: pnpm install

- name: Build apps
run: |
cp .env.ci .env
yarn build --filter=frontend --filter=backend
pnpm build
- name: Run Playwright tests
# with workground https://github.com/microsoft/playwright/issues/6500
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ node_modules/
/playwright/.cache/


.cache
sandbox
.adminjs
.eslintcache
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint ${1}
pnpm commitlint --edit
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
# npx lint-staged
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node-linker=hoisted
enable-pre-post-scripts=true
package-manager-strict=false
Binary file removed .yarn/install-state.gz
Binary file not shown.
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

10 changes: 2 additions & 8 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
compressionLevel: mixed

enableGlobalCache: true

enableTelemetry: false
Expand All @@ -13,11 +15,3 @@ logFilters:
level: discard

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.4.1.cjs
15 changes: 0 additions & 15 deletions Caddyfile

This file was deleted.

53 changes: 19 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,45 @@
FROM node:20-alpine AS custom-node
FROM node:20-alpine AS base
RUN apk add --no-cache libc6-compat ffmpeg bash openssl openssl-dev
RUN npm install -g turbo pnpm

RUN apk add -f --update --no-cache --virtual .gyp nano bash libc6-compat python3 make g++ caddy \
&& yarn global add turbo pm2 \
&& apk del .gyp


FROM custom-node AS pruned
FROM base AS pruned
WORKDIR /app
ARG APP

COPY . .
RUN turbo prune --scope=frontend --docker

RUN turbo prune --scope=$APP --docker

FROM custom-node AS installer
FROM base AS installer
WORKDIR /app
ARG APP

COPY --from=pruned /app/out/json/ .
COPY --from=pruned /app/out/yarn.lock /app/yarn.lock
COPY --from=pruned /app/out/pnpm-lock.yaml /app/pnpm-lock.yaml

RUN \
--mount=type=cache,target=/usr/local/share/.cache/yarn/v6,sharing=private \
yarn
--mount=type=cache,target=/root/.local/share/pnpm/store,sharing=private \
pnpm install --frozen-lockfile

FROM custom-node as builder
FROM base as builder
WORKDIR /app
ARG APP
ARG API_URL
ARG COMMIT

ENV COMMIT=${COMMIT}
ENV API_URL=${API_URL}

COPY --from=installer --link /app .

COPY --from=pruned /app/out/full/ .
COPY turbo.json turbo.json
COPY tsconfig.json tsconfig.json

RUN turbo run build --no-cache --filter=${APP}
RUN turbo run build --no-cache

RUN \
--mount=type=cache,target=/usr/local/share/.cache/yarn/v6,sharing=private \
yarn --frozen-lockfile
--mount=type=cache,target=/root/.local/share/pnpm/store,sharing=private \
pnpm install --frozen-lockfile

#############################################
FROM node:20-alpine AS runner
FROM base AS runner
WORKDIR /app
ARG APP=admin
ARG START_COMMAND=dev

ENV APP=${APP}
ENV START_COMMAND=${START_COMMAND}
ENV PORT=3000
RUN apk add --no-cache ffmpeg curl bash openssl openssl-dev

COPY --from=builder /app .

CMD yarn workspace ${APP} ${START_COMMAND}
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
CMD curl -f http://localhost:3000/ || exit 1

CMD ["sh", "-c", "pnpm prisma migrate:deploy & pnpm frontend start"]
56 changes: 0 additions & 56 deletions Dockerfile.compact

This file was deleted.

Loading

0 comments on commit e4d064a

Please sign in to comment.