-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
358 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
node_modules | ||
public/build | ||
build | ||
dist | ||
out | ||
coverage | ||
.history | ||
.react-router | ||
|
||
# Other Coverage tools | ||
*.lcov | ||
|
||
# macOS | ||
.DS_* | ||
**/.DS_* | ||
|
||
# Cache Directories and files | ||
.cache | ||
.yarn* | ||
.env* | ||
!.env.example | ||
.swp* | ||
.turbo | ||
.npm | ||
.stylelintcache | ||
*.tsbuildinfo | ||
.node_repl_history | ||
|
||
# Lock files from other package managers | ||
package-lock.json | ||
yarn.lock | ||
|
||
# General tempory files and directories | ||
t?mp | ||
.t?mp | ||
*.t?mp | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
*.tar | ||
*.tar.gz | ||
*.tar.bz2 | ||
*.tbz | ||
*.zip | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
vite.config.ts.* | ||
|
||
# Playwright various test reports | ||
test-results | ||
playwright-report | ||
blob-report | ||
|
||
|
||
# Editors | ||
.idea/workspace.xml | ||
.idea/usage.statistics.xml | ||
.idea/shelf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# Add your env variables here | ||
APP_DEPLOYMENT_ENV="staging" | ||
SUPABASE_URL=op://Shared/supabase-realtime/$APP_DEPLOYMENT_ENV/SUPABASE_URL | ||
SUPABASE_KEY=op://Shared/supabase-realtime/$APP_DEPLOYMENT_ENV/SUPABASE_KEY | ||
DATABASE_URL=op://Shared/supabase-realtime/$APP_DEPLOYMENT_ENV/DATABASE_URL | ||
DIRECT_URL=op://Shared/supabase-realtime/$APP_DEPLOYMENT_ENV/DIRECT_URL | ||
SESSION_SECRET=op://Shared/supabase-realtime/$APP_DEPLOYMENT_ENV/SESSION_SECRET | ||
|
||
# development, staging, production | ||
# Default is development. | ||
#APP_DEPLOYMENT_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 👀 Branch Preview | ||
concurrency: | ||
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [main] # Delete this line to enable deployment of all created branches. Note: you already have PR preview deploys! | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
FLY_ORG: ${{ vars.FLY_ORG }} | ||
FLY_REGION: ${{ vars.FLY_REGION }} | ||
|
||
jobs: | ||
deploy-branch-preview: | ||
name: "🚀 Deploy Preview" | ||
uses: forge42dev/workflows/.github/workflows/deploy-to-fly.yaml@monorepo-matrix | ||
with: | ||
fly_app_name: f42-memory-game-branch-${{ github.ref_name }} | ||
fly_config_file_path: fly.staging.toml | ||
github_environment: "branch-preview" | ||
secrets: | ||
fly_api_token: ${{ secrets.FLY_API_TOKEN }} | ||
fly_secrets: | | ||
SUPABASE_URL=${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY=${{ secrets.SUPABASE_KEY }} | ||
DATABASE_URL=${{ secrets.DATABASE_URL }} | ||
DIRECT_URL=${{ secrets.DIRECT_URL }} | ||
SESSION_SECRET=${{ secrets.SESSION_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
name: 🔥 Deploy to Production | ||
concurrency: | ||
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
FLY_ORG: ${{ vars.FLY_ORG }} | ||
FLY_REGION: ${{ vars.FLY_REGION }} | ||
|
||
jobs: | ||
deploy-production: | ||
name: "🔥 Deploy to Production based on '${{ github.ref_name }}' ${{ github.ref_type }}" | ||
uses: forge42dev/workflows/.github/workflows/deploy-to-fly.yaml@monorepo-matrix | ||
with: | ||
fly_app_name: f42-memory-game-production | ||
fly_config_file_path: fly.production.toml | ||
github_environment: "production" | ||
secrets: | ||
fly_api_token: ${{ secrets.FLY_API_TOKEN }} | ||
fly_secrets: | | ||
SUPABASE_URL=${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY=${{ secrets.SUPABASE_KEY }} | ||
DATABASE_URL=${{ secrets.DATABASE_URL }} | ||
DIRECT_URL=${{ secrets.DIRECT_URL }} | ||
SESSION_SECRET=${{ secrets.SESSION_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Destroy PR Preview | ||
|
||
concurrency: | ||
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
destroy-pr-preview: | ||
name: "Destroying preview deployment for PR#${{ github.event.number }}" | ||
runs-on: ubuntu-latest | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
steps: | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl apps destroy "f42-memory-game-pr-${{ github.event.number }}" --yes || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
|
||
# Adjust NODE_VERSION as desired | ||
ARG NODE_VERSION=22.11.0 | ||
FROM node:${NODE_VERSION}-slim AS base | ||
|
||
# Node.js app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ENV NODE_ENV="production" | ||
|
||
# Install pnpm | ||
ARG PNPM_VERSION=9.14.4 | ||
RUN npm install -g pnpm@$PNPM_VERSION | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install -y ca-certificates openssl | ||
|
||
# Install node modules | ||
COPY .npmrc package.json pnpm-lock.yaml ./ | ||
RUN pnpm install --frozen-lockfile --prod=false | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
RUN pnpm prisma generate | ||
|
||
# Build application | ||
RUN pnpm run build | ||
|
||
# Remove development dependencies | ||
RUN pnpm prune --prod | ||
|
||
# Copy built application | ||
COPY /app /app | ||
|
||
ENV PORT="8080" | ||
EXPOSE $PORT | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
CMD [ "pnpm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
primary_region = 'fra' | ||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
|
||
[env] | ||
APP_DEPLOYMENT_ENV = "production" | ||
|
||
[deploy] | ||
strategy = "rolling" | ||
|
||
[[services]] | ||
protocol = "tcp" | ||
auto_stop_machines = "suspend" | ||
auto_start_machines = true | ||
min_machines_running = 1 | ||
processes = ['app'] | ||
|
||
[services.concurrency] | ||
hard_limit = 100 | ||
soft_limit = 50 | ||
type = "requests" | ||
|
||
[[services.ports]] | ||
handlers = ["tls", "http"] | ||
port = 443 | ||
|
||
[[services.tcp_checks]] | ||
grace_period = "1s" | ||
interval = "15s" | ||
restart_limit = 0 | ||
timeout = "2s" | ||
|
||
[[vm]] | ||
size = "shared-cpu-1x" | ||
memory = "512mb" | ||
processes = ["app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
primary_region = 'fra' | ||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
|
||
[env] | ||
APP_DEPLOYMENT_ENV = "staging" | ||
|
||
[deploy] | ||
strategy = "rolling" | ||
|
||
[[services]] | ||
protocol = "tcp" | ||
auto_stop_machines = "suspend" | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[services.concurrency] | ||
hard_limit = 100 | ||
soft_limit = 50 | ||
type = "requests" | ||
|
||
[[services.ports]] | ||
handlers = ["tls", "http"] | ||
port = 443 | ||
|
||
[[services.tcp_checks]] | ||
grace_period = "1s" | ||
interval = "15s" | ||
restart_limit = 0 | ||
timeout = "2s" | ||
|
||
[[vm]] | ||
size = "shared-cpu-1x" | ||
memory = "512mb" | ||
processes = ["app"] |
Oops, something went wrong.