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

Feat/embed cnpg #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 7 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL=""
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SENTRY_ENV="dev"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
7 changes: 7 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SENTRY_ENV="production"
NEXT_PUBLIC_MATOMO_URL="https://matomo.fabrique.social.gouv.fr"
NEXT_PUBLIC_MATOMO_SITE_ID=63
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
7 changes: 7 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SENTRY_ENV="development"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"next/core-web-vitals",
"plugin:storybook/recommended",
"plugin:jsx-a11y/recommended"
]
}
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
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"]
}
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on: [pull_request, push]

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

jobs:
build:
name: Build and export
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: Build and export
run: |
yarn build
75 changes: 75 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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:
# The branches below must be a subset of the branches above
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
23 changes: 23 additions & 0 deletions .github/workflows/deactivate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ♻️ Deactivate
on:
pull_request:
types: [closed]
delete:
branches:
- "**"
- "!v*"
- "!master"
- "!main"
- "!dev"
- "!develop"
- "!**/persist"
- "!persist/**"
- "!**/persist/**"
- "!persist-**"
- "!**-persist"
- "!**-persist-**"

jobs:
socialgouv:
uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate.yaml@v1
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/debug-kube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Debug kube

on:
workflow_dispatch:
push:
branches:
- "feat/**"
- "fix/**"


jobs:
dump:
name: Debug kube
runs-on: ubuntu-latest
steps:
- uses: azure/setup-kubectl@v3
- name: extract kubeconfig
run: |
echo -n "${{secrets.KUBECONFIG}}" | base64 --decode > kubeconfig
- name: list kube data
run: |
KUBECONFIG=./kubeconfig kubectl config get-contexts
26 changes: 26 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Testing e2e

on: pull_request

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

jobs:
e2e:
name: Testing e2e
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v5
with:
build: yarn build
start: yarn start
component: false
install-command: yarn --immutable
env:
NEXTAUTH_URL: "http://keycloak:3000"
NEXTAUTH_SECRET: "A+EQqudlGhqTLDnBbCvohHBfbhUjTXAbZYy1NKsSsys="
NEXT_PUBLIC_HASURA_GRAPHQL_ENDPOINT_URL: "http://hasura:8082/v1/graphql"
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on: [pull_request, push]

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:
recursive: true
19 changes: 19 additions & 0 deletions .github/workflows/preproduction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 😎 PreProd
on:
workflow_dispatch:
push:
branches:
- "master"
- "main"
tags-ignore:
- v*

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

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction.yaml@v1
secrets: inherit
16 changes: 16 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 🚀 Production
on:
workflow_dispatch:
push:
tags:
- v*

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

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-production.yaml@v1
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: socialgouv/workflows/actions/semantic-release@v1
with:
github-token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
author-name: ${{ secrets.SOCIALGROOVYBOT_NAME }}
author-email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
16 changes: 16 additions & 0 deletions .github/workflows/review-auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 👓 Review Auto
on:
push:
branches:
- "feat/**"
- "fix/**"

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

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto.yaml@v1
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 👀 Review
on:
push:
branches:
- "**"
- "!master"
- "!main"
- "!feat/**"
- "!fix/**"

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

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-review.yaml@v1
secrets: inherit
Loading
Loading