Skip to content

Commit

Permalink
Merge pull request #249 from valerymelou/develop
Browse files Browse the repository at this point in the history
Prod release
  • Loading branch information
valerymelou authored Jul 23, 2024
2 parents 038a574 + 54bb13e commit 111e261
Show file tree
Hide file tree
Showing 393 changed files with 167,128 additions and 18,541 deletions.
13 changes: 13 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '2'
exclude_patterns:
- '**/*.spec.ts'
- '**/jest.config.ts'
- '**/test-setup.ts'
- '**/tests/*.py'
checks:
similar-code:
config:
threshold: 100
identical-code:
config:
threshold: 100
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Editor configuration, see https://editorconfig.org
# Editor configuration, see http://editorconfig.org
root = true

[*]
Expand All @@ -8,9 +8,6 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
101 changes: 101 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
on:
workflow_call:
repository_dispatch:
types: [publish-event]

jobs:
build:
runs-on: ubuntu-latest
environment: ${{ (github.event.client_payload.env && github.event_name == 'repository_dispatch') && github.event.client_payload.env || (github.ref == 'refs/heads/master' && 'production' || 'staging') }}
env:
VM_CONTENTFUL_SPACE: ${{ secrets.VM_CONTENTFUL_SPACE }}
VM_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.VM_CONTENTFUL_ACCESS_TOKEN }}
VM_CONTENTFUL_ENVIRONMENT: ${{ (github.event.client_payload.env && github.event_name == 'repository_dispatch') && github.event.client_payload.env || (github.ref == 'refs/heads/master' && 'production' || 'staging') }}
outputs:
ENVIRONMENT: ${{ env.VM_CONTENTFUL_ENVIRONMENT }}
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- run: yarn install
# Generate the routes for prerendering. This is the only way I found to pass
# environment variables to the executor.
- run: VM_CONTENTFUL_SPACE=${{ env.VM_CONTENTFUL_SPACE }} VM_CONTENTFUL_ACCESS_TOKEN=${{ env.VM_CONTENTFUL_ACCESS_TOKEN }} VM_CONTENTFUL_ENVIRONMENT=${{ env.VM_CONTENTFUL_ENVIRONMENT }} yarn nx run website:build-routes
- run: npx nx run website:prerender

- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: build-output-${{ env.VM_CONTENTFUL_ENVIRONMENT }}
path: |
dist
preview:
if: ${{ github.event.pull_request.base.ref == 'develop' }}
needs: build
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4

- name: Download build result
uses: actions/download-artifact@v4
with:
path: dist
name: build-output-${{ needs.build.outputs.ENVIRONMENT }}

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
channelId: preview
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
target: ${{ secrets.FIREBASE_SITE_TARGET }}

staging:
if: github.ref == 'refs/heads/develop'
needs: build
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4

- name: Download build result
uses: actions/download-artifact@v4
with:
path: dist
name: build-output-${{ needs.build.outputs.ENVIRONMENT }}

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
channelId: live
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
target: ${{ secrets.FIREBASE_SITE_TARGET }}

production:
if: github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4

- name: Download build result
uses: actions/download-artifact@v4
with:
path: dist
name: build-output-${{ needs.build.outputs.ENVIRONMENT }}

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
channelId: live
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches: ['master', 'develop']
pull_request:
branches: ['master', 'develop']

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

permissions:
actions: read
contents: read
checks: write
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: develop

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- run: yarn install
- run: npx nx affected --target=lint --parallel=3
- run: npx nx run-many --target=test --parallel=3 --code-coverage
- run: yarn merge-lcov

- name: Code Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/lcov.info:lcov
deploy:
if: >
(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || (github.event.pull_request.base.ref == 'develop' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'valerymelou'))
needs: test
uses: ./.github/workflows/cd.yml
secrets: inherit
21 changes: 9 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
dist
tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
node_modules

# IDEs and editors
/.idea
Expand All @@ -29,7 +23,6 @@ speed-measure-plugin*.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
Expand All @@ -45,5 +38,9 @@ testem.log
.DS_Store
Thumbs.db

# Scully
scully.log
.nx/cache
.nx/workspace-data
.angular
.env
.firebaserc
routes.txt
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx/workspace-data
.angular
86 changes: 0 additions & 86 deletions .snyk

This file was deleted.

Loading

0 comments on commit 111e261

Please sign in to comment.