Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet authored Dec 12, 2024
0 parents commit 5524df7
Show file tree
Hide file tree
Showing 112 changed files with 137,586 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
yarn-debug.log
README.md
CHANGELOG.md
.next
.vscode
.github
.kontinuous
.git
8 changes: 8 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL=""
NEXT_PUBLIC_SENTRY_DSN="https://xxx/yy"
NEXT_PUBLIC_SENTRY_ENV="dev"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template-nextjs"
NEXT_PUBLIC_BASE_PATH=/template-nextjs
9 changes: 9 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.beta.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/159"
NEXT_PUBLIC_SENTRY_ENV="production"
NEXT_PUBLIC_MATOMO_URL="https://stats.beta.gouv.fr"
NEXT_PUBLIC_MATOMO_SITE_ID=124
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template-nextjs"
PRODUCTION=true
NEXT_PUBLIC_BASE_PATH=/template-nextjs
8 changes: 8 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.incubateur.net/"
NEXT_PUBLIC_SENTRY_DSN="https://xxx/yy"
NEXT_PUBLIC_SENTRY_ENV="staging"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template"
NEXT_PUBLIC_BASE_PATH=/template-nextjs
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"next/core-web-vitals",
"plugin:storybook/recommended",
"plugin:jsx-a11y/recommended"
],
"rules": { "react/no-unescaped-entities": "warn" }
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Protect workflow files
.github/workflows/*.yml @socialgouv/sre
.github/CODEOWNERS @socialgouv/sre
.kontinuous/ @socialgouv/sre
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"enabled": true,
"extends": ["github>SocialGouv/renovate-config:light"],
"baseBranches": ["main", "hasura"]
}
74 changes: 74 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 🔎 CodeQL

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "16 1 * * 5"

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

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 🌍 Deploy demo

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

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

jobs:
build:
name: Deployment demo on gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"

- name: Install dependencies
run: |
yarn --immutable
- name: Build
env:
NODE_ENV: production # JS build mode
PRODUCTION: true # for environment (ex: robots.txt)
SENTRY_URL: https://sentry.incubateur.net
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: betagouv
SENTRY_PROJECT: template-nextjs
SENTRY_RELEASE_UPLOAD: true
run: |
yarn build
touch out/.nojekyll
# deploy build to gh-pages
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: out
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ⛑️ Lint

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

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

jobs:
code:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies
run: |
yarn --immutable
- name: Lint
run: |
yarn lint
docker:
name: Lint Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
verbose: true
34 changes: 34 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 🤖 Playwright Tests

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

jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build app
run: yarn build
env:
NEXT_PUBLIC_BASE_PATH: ""
NODE_ENV: production
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 📦 Release

on:
workflow_dispatch:
push:
branches: [main, alpha, beta, next]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 💪 Testing

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

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

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: |
yarn --immutable
- name: Build code
run: |
yarn build
- name: Test code
run: |
yarn test
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo

# VSCode
.vscode

# Cypress
cypress/videos
cypress/screenshots

# Robots.txt
robots.txt

# yarn berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# storybook
/.out
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then
exec </dev/tty; yarn node-talisman --githook pre-commit -i;
else
yarn node-talisman --githook pre-commit;
fi
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
Loading

0 comments on commit 5524df7

Please sign in to comment.