Skip to content

Commit

Permalink
Merge pull request #1022 from AletheiaFact/stage
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
thesocialdev authored Oct 4, 2023
2 parents ea2f342 + 3c869d5 commit afb381e
Show file tree
Hide file tree
Showing 3,061 changed files with 36,763 additions and 87,255 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
36 changes: 24 additions & 12 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ env:
ORY_ACCESS_TOKEN: ${{ secrets.DEVELOPMENT_ORY_ACCESS_TOKEN }}
ALETHEIA_SCHEMA_ID: ${{ secrets.DEVELOPMENT_ALETHEIA_SCHEMA_ID }}
RECAPTCHA_SITEKEY: ${{ secrets.RECAPTCHA_SITEKEY }}
NOVU_API_KEY: ${{ secrets.DEVELOPMENT_NOVU_API_KEY }}
NOVU_APPLICATION_IDENTIFIER: ${{ secrets.DEVELOPMENT_NOVU_APPLICATION_IDENTIFIER }}


GITLAB_FEATURE_FLAG_URL: ${{ secrets.GITLAB_FEATURE_FLAG_URL }}
GITLAB_FEATURE_FLAG_INSTANCE_ID: ${{ secrets.GITLAB_FEATURE_FLAG_INSTANCE_ID }}
Expand All @@ -45,7 +48,8 @@ jobs:
- name: Check Environment
if: endsWith(github.ref, '/master')
run: |
sed -i '11{s/test.//}' deployment.yml
sed -i '11{s/test.//}' deployment/app.yml
sed -i '11{s/testws./ws./}' deployment/websocket.yml
sed -i '11{s/test.//}' config.seed.example.yaml
echo "ENVIRONMENT=production" >> $GITHUB_ENV
echo "UMAMI_SITE_ID=${{ secrets.PRODUCTION_UMAMI_SITE_ID }}" >> $GITHUB_ENV
Expand All @@ -59,6 +63,8 @@ jobs:
echo "AWS_SDK_BUCKET=${{ secrets.PRODUCTION_AWS_SDK_BUCKET }}" >> $GITHUB_ENV
echo "AWS_ACCESS_KEY_ID=${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
echo "NOVU_API_KEY=${{ secrets.PRODUCTION_NOVU_API_KEY }}" >> $GITHUB_ENV
echo "NOVU_APPLICATION_IDENTIFIER=${{ secrets.PRODUCTION_NOVU_APPLICATION_IDENTIFIER }}" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -87,6 +93,8 @@ jobs:
sed -i "s%AWS_SDK_BUCKET%$AWS_SDK_BUCKET%g" config.$ENVIRONMENT.yaml
sed -i "s%AWS_ACCESS_KEY_ID%$AWS_ACCESS_KEY_ID%g" config.$ENVIRONMENT.yaml
sed -i "s%AWS_SECRET_ACCESS_KEY%$AWS_SECRET_ACCESS_KEY%g" config.$ENVIRONMENT.yaml
sed -i "s%NOVU_API_KEY%$NOVU_API_KEY%g" config.$ENVIRONMENT.yaml
sed -i "s%NOVU_APPLICATION_IDENTIFIER%$NOVU_APPLICATION_IDENTIFIER%g" config.$ENVIRONMENT.yaml
- name: Set migrate-mongo-config.ts
run: |
Expand Down Expand Up @@ -139,7 +147,7 @@ jobs:
- name: Check Environment
if: endsWith(github.ref, '/master')
run: |
sed -i '11{s/test.//}' deployment.yml
sed -i '11{s/test.//}' deployment/app.yml
echo "ENVIRONMENT=production" >> $GITHUB_ENV
echo "UMAMI_SITE_ID=${{ secrets.PRODUCTION_UMAMI_SITE_ID }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_UMAMI_SITE_ID=${{ secrets.PRODUCTION_UMAMI_SITE_ID }}" >> $GITHUB_ENV
Expand All @@ -152,18 +160,22 @@ jobs:
echo "AWS_SDK_BUCKET=${{ secrets.PRODUCTION_AWS_SDK_BUCKET }}" >> $GITHUB_ENV
echo "AWS_ACCESS_KEY_ID=${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
echo "NOVU_API_KEY=${{ secrets.PRODUCTION_NOVU_API_KEY }}" >> $GITHUB_ENV
echo "NOVU_APPLICATION_IDENTIFIER=${{ secrets.PRODUCTION_NOVU_APPLICATION_IDENTIFIER }}" >> $GITHUB_ENV
- name: Set environment
run: |
sed -i "s/ENVIRONMENT/${{ env.ENVIRONMENT }}/g" deployment.yml
sed -i "s/UMAMI_SITE_ID_STUB/${{ env.UMAMI_SITE_ID }}/g" deployment.yml
sed -i "s/RECAPTCHA_SITEKEY_STUB/${{ env.RECAPTCHA_SITEKEY }}/g" deployment.yml
sed -i "s%ORY_SDK_URL_STUB%${{ env.ORY_SDK_URL }}%g" deployment.yml
sed -i "s/ORY_ACCESS_TOKEN_STUB/${{ env.ORY_ACCESS_TOKEN }}/g" deployment.yml
- name: Set deployment.yml
sed -i "s/ENVIRONMENT/${{ env.ENVIRONMENT }}/g" deployment/app.yml
sed -i "s/ENVIRONMENT/${{ env.ENVIRONMENT }}/g" deployment/websocket.yml
sed -i "s/UMAMI_SITE_ID_STUB/${{ env.UMAMI_SITE_ID }}/g" deployment/app.yml
sed -i "s/RECAPTCHA_SITEKEY_STUB/${{ env.RECAPTCHA_SITEKEY }}/g" deployment/app.yml
sed -i "s%ORY_SDK_URL_STUB%${{ env.ORY_SDK_URL }}%g" deployment/app.yml
sed -i "s/ORY_ACCESS_TOKEN_STUB/${{ env.ORY_ACCESS_TOKEN }}/g" deployment/app.yml
- name: Set deployment
run: |
sed -i "s/TAG/$GITHUB_SHA/" deployment.yml
sed -i "s/TAG/$GITHUB_SHA/" deployment/app.yml
sed -i "s/TAG/$GITHUB_SHA/" deployment/websocket.yml
- name: Applying Kubernetes Deployment
uses: giovannirossini/aws-eks@v1
Expand All @@ -172,7 +184,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'
cluster-name: 'production'
command: kubectl apply -f deployment.yml
command: kubectl apply -f ./deployment/

- name: Validation
uses: giovannirossini/aws-eks@v1
Expand All @@ -181,7 +193,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'
cluster-name: 'production'
command: kubectl rollout status deployments/aletheia -n ${{ env.ENVIRONMENT }} --timeout=240s
command: kubectl rollout status deployments/aletheia -n ${{ env.ENVIRONMENT }} --timeout=360s
if: success()

- name: Rollback
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy docs to aws s3 bucket
on:
push:
branches: [ stage ]
permissions:
id-token: write # This is required for aws oidc connection
contents: read # This is required for actions/checkout
pull-requests: write # This is required for gh bot to comment PR

jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
env:
BUCKET: ${{ secrets.ALETHEIA_DOCS_AWS_BUCKET_NAME }}
DIST: docs
REGION: eu-north-1

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ALETHEIA_DOCS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ALETHEIA_DOCS_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REGION }}

- name: Install Dependencies
run: |
node --version
yarn install
- name: Build Static Website
run: |
yarn run build-storybook
npx compodoc -p tsconfig.json -d ./docs/compodoc
- name: Copy files to the production website with the AWS CLI
run: |
aws s3 sync --delete ${{ env.DIST }} s3://${{ env.BUCKET }}
36 changes: 22 additions & 14 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
ORY_ACCESS_TOKEN: ${{ secrets.DEVELOPMENT_ORY_ACCESS_TOKEN }}
ALETHEIA_SCHEMA_ID: ${{ secrets.DEVELOPMENT_ALETHEIA_SCHEMA_ID }}
CI_ORY_USERID: ${{ secrets.CI_ORY_USERID }}
CI_MONGODB_URI: mongodb://localhost:35025/Aletheia
CI_MONGODB_URI: mongodb://127.0.0.1:35025/Aletheia
TEST_RECAPTCHA_SECRET: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe # public secret for CI tests provided by google
TEST_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
NEXT_PUBLIC_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
Expand All @@ -32,7 +32,7 @@ jobs:

strategy:
matrix:
node-version: [16.19.0]
node-version: [18.14.0]

steps:
- uses: actions/checkout@v2
Expand All @@ -44,15 +44,23 @@ jobs:
- run: yarn build
- run: yarn lint
- run: yarn test
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: yarn test:e2e:cy
wait-on: 'http://localhost:3000'
env:
CI: true
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Test docker image build before merge
run: |
docker build --build-arg ENVIRONMENT=development \
--build-arg NEXT_PUBLIC_UMAMI_SITE_ID=$NEXT_PUBLIC_UMAMI_SITE_ID \
--build-arg NEXT_PUBLIC_RECAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_RECAPTCHA_SITEKEY }} .
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: yarn test:e2e:cy
wait-on: 'http://localhost:3000'
env:
CI: true

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ yarn-error.log*
dist

config.yaml
config.nest.yaml
config.seed.yaml
config.websocket.yaml
migrate-mongo-config.*

.idea/**/*
Expand Down Expand Up @@ -60,3 +60,7 @@ data/localstack/startup_info.json

# localstack
data

# Auto-generated documentation
docs/compodoc/**/*
docs/storybook/**/*
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.19.0
18.14.0
28 changes: 16 additions & 12 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
module.exports = {
stories: [
"../src/stories/**/*.stories.*",
],
stories: ["../src/stories/**/*.stories.*"],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/preset-ant-design",
"storybook-addon-next-router"
],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-webpack5"

framework: {
name: "@storybook/nextjs",
options: {},
},

webpackFinal: async (config, { configType }) => {
config.resolve.alias = {
...config.resolve.alias,
"next-i18next": "react-i18next"
}
return config
}
}
"next-i18next": "react-i18next",
};
return config;
},

docs: {
autodocs: true,
},
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit afb381e

Please sign in to comment.